You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "C.F. Scheidecker Antunes" <na...@antunes.eti.br> on 2005/08/15 09:16:40 UTC

Multiple file upload

Hello all,

Is there any way to perform multiple file uploads using Jakarta Commons 
Upload on a Struts application?
Is there any howto on this issu?

Thanks,
C.F.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validator's indexedListProperty

Posted by Josh Cronemeyer <jo...@ink.org>.
Ok, Looks like at least a few other people have found Struts guilty here.  I
have found a existing bug report 23372
http://issues.apache.org/bugzilla/show_bug.cgi?id=23372 that deals with this.
Basically Validator can handle indexed properties, but the indexed error
messages that it creates cannot be handled by the Struts custom JSP taglibs.
Perhaps I can write some custom taglibs to work around this.  On the subject
of custom taglibs if anyone is interested I have created a simple tutorial
based on a custom struts tag I created.  It is a custom <div> tag that lets
you change the class or id of the div when there are errors for the given
property.  Here is the link.  http://www.cuberick.com/?p=2  Lemme know if you
have any suggestions or questions.

On Mon, Aug 22, 2005 at 03:52:30PM -0500, Josh Cronemeyer wrote:
> On Mon, Aug 22, 2005 at 11:18:50AM -0500, Josh Cronemeyer wrote:
> > Hi,
> > 
> > I've been playing with the indexedListProperty to validate what a user has
> > selected in my forms.  The problem I am having is that when an error message
> > gets returned, It does not get associated with the form element
> > (<html:multibox property="test"> in my case).  I think the problem is that
> > the message comes back with a key of test[x] where x is the index of the
> > error.  If I just print out my error messages like this <html:errors/> I can
> > see the error message, but <html:errors property="test"/> doesn't show
> > anything.  It seems like the <html:errors> tag should have an
> > indexedListProperty parameter as well so I can display my error messages
> > correctly.  What am i missing?
> > 
> > Regards,
> > 
> > josh cronemeyer
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> >
> I've looked all over in the struts user guide and googled for information on
> this.  It appears that while the validator can handle validation of indexed
> beans in forms, the struts JSP taglibs cannot handle the resulting indexed
> messages.  Could this be a bug?  It sure looks that way.
> 
> Thanks, 
> josh cronemeyer 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Re: Validator's indexedListProperty

Posted by Dave Newton <ne...@pingsite.com>.
Josh Cronemeyer wrote:

>I'm having some problems with mutt or imapfilter or something. I'm getting
>all the email I send to list list except ones with the subject of this
>thread.  It is really weird.
>  
>
Technology: Improving our lives one reboot at a time.

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Re: Validator's indexedListProperty

Posted by Josh Cronemeyer <jo...@ink.org>.
On Wed, Aug 24, 2005 at 05:13:28PM -0400, Dave Newton wrote:
> Dave Newton wrote:
> 
> >Feel free to assume we've all seen it three times now.
> 
> I meant four.
> 
> Dave
> 

*hat in hand*

I'm having some problems with mutt or imapfilter or something. I'm getting
all the email I send to list list except ones with the subject of this
thread.  It is really weird.  Didn't mean to make you all see double, 
uh i mean quadruple.  Shame on me!

-josh
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


[OT] Re: Validator's indexedListProperty

Posted by Dave Newton <ne...@pingsite.com>.
Dave Newton wrote:

> Feel free to assume we've all seen it three times now.

I meant four.

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validator's indexedListProperty

Posted by Dave Newton <ne...@pingsite.com>.
Josh Cronemeyer wrote:

>Looks like at least a few other people have this same issue I do.  I
>have found a existing bug report 23372 
>http://issues.apache.org/bugzilla/show_bug.cgi?id=23372 that deals with this.
>Basically Validator can handle indexed properties, but the indexed error
>messages that it creates cannot be handled by the Struts custom JSP taglibs.
>Perhaps I can write some custom taglibs to work around this.  On the subject
>of custom taglibs if anyone is interested I have created a simple tutorial
>based on a custom struts tag I created.  It is a custom <div> tag that lets
>you change the class or id of the div when there are errors for the given
>property.  Here is the link.  http://www.cuberick.com/?p=2  Lemme know if you
>have any suggestions or questions.
>
>
>Hmm, I don't know where my emails are ending up, but this is my 3rd attempt
>to respond to this (my own) thread.
>  
>
They're ending up on the list :/

Feel free to assume we've all seen it three times now.

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validator's indexedListProperty

Posted by Josh Cronemeyer <jo...@ink.org>.
Looks like at least a few other people have this same issue I do.  I
have found a existing bug report 23372 
http://issues.apache.org/bugzilla/show_bug.cgi?id=23372 that deals with this.
Basically Validator can handle indexed properties, but the indexed error
messages that it creates cannot be handled by the Struts custom JSP taglibs.
Perhaps I can write some custom taglibs to work around this.  On the subject
of custom taglibs if anyone is interested I have created a simple tutorial
based on a custom struts tag I created.  It is a custom <div> tag that lets
you change the class or id of the div when there are errors for the given
property.  Here is the link.  http://www.cuberick.com/?p=2  Lemme know if you
have any suggestions or questions.


Hmm, I don't know where my emails are ending up, but this is my 3rd attempt
to respond to this (my own) thread.

-josh


On Mon, Aug 22, 2005 at 03:52:30PM -0500, Josh Cronemeyer wrote:
> On Mon, Aug 22, 2005 at 11:18:50AM -0500, Josh Cronemeyer wrote:
> > Hi,
> > 
> > I've been playing with the indexedListProperty to validate what a user has
> > selected in my forms.  The problem I am having is that when an error message
> > gets returned, It does not get associated with the form element
> > (<html:multibox property="test"> in my case).  I think the problem is that
> > the message comes back with a key of test[x] where x is the index of the
> > error.  If I just print out my error messages like this <html:errors/> I can
> > see the error message, but <html:errors property="test"/> doesn't show
> > anything.  It seems like the <html:errors> tag should have an
> > indexedListProperty parameter as well so I can display my error messages
> > correctly.  What am i missing?
> > 
> > Regards,
> > 
> > josh cronemeyer
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> >
> I've looked all over in the struts user guide and googled for information on
> this.  It appears that while the validator can handle validation of indexed
> beans in forms, the struts JSP taglibs cannot handle the resulting indexed
> messages.  Could this be a bug?  It sure looks that way.
> 
> Thanks, 
> josh cronemeyer 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validator's indexedListProperty

Posted by Josh Cronemeyer <jo...@ink.org>.
Ok, Looks like at least a few other people have found Struts guilty here.  I
have found a existing bug report 23372
http://issues.apache.org/bugzilla/show_bug.cgi?id=23372 that deals with this.
Basically Validator can handle indexed properties, but the indexed error
messages that it creates cannot be handled by the Struts custom JSP taglibs.
Perhaps I can write some custom taglibs to work around this.  On the subject
of custom taglibs if anyone is interested I have created a simple tutorial
based on a custom struts tag I created.  It is a custom <div> tag that lets
you change the class or id of the div when there are errors for the given
property.  Here is the link.  http://www.cuberick.com/?p=2  Lemme know if you
have any suggestions or questions.

On Mon, Aug 22, 2005 at 03:52:30PM -0500, Josh Cronemeyer wrote:
> On Mon, Aug 22, 2005 at 11:18:50AM -0500, Josh Cronemeyer wrote:
> > Hi,
> > 
> > I've been playing with the indexedListProperty to validate what a user has
> > selected in my forms.  The problem I am having is that when an error message
> > gets returned, It does not get associated with the form element
> > (<html:multibox property="test"> in my case).  I think the problem is that
> > the message comes back with a key of test[x] where x is the index of the
> > error.  If I just print out my error messages like this <html:errors/> I can
> > see the error message, but <html:errors property="test"/> doesn't show
> > anything.  It seems like the <html:errors> tag should have an
> > indexedListProperty parameter as well so I can display my error messages
> > correctly.  What am i missing?
> > 
> > Regards,
> > 
> > josh cronemeyer
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> >
> I've looked all over in the struts user guide and googled for information on
> this.  It appears that while the validator can handle validation of indexed
> beans in forms, the struts JSP taglibs cannot handle the resulting indexed
> messages.  Could this be a bug?  It sure looks that way.
> 
> Thanks, 
> josh cronemeyer 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Validator's indexedListProperty

Posted by Josh Cronemeyer <jo...@ink.org>.
On Mon, Aug 22, 2005 at 11:18:50AM -0500, Josh Cronemeyer wrote:
> Hi,
> 
> I've been playing with the indexedListProperty to validate what a user has
> selected in my forms.  The problem I am having is that when an error message
> gets returned, It does not get associated with the form element
> (<html:multibox property="test"> in my case).  I think the problem is that
> the message comes back with a key of test[x] where x is the index of the
> error.  If I just print out my error messages like this <html:errors/> I can
> see the error message, but <html:errors property="test"/> doesn't show
> anything.  It seems like the <html:errors> tag should have an
> indexedListProperty parameter as well so I can display my error messages
> correctly.  What am i missing?
> 
> Regards,
> 
> josh cronemeyer
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>
I've looked all over in the struts user guide and googled for information on
this.  It appears that while the validator can handle validation of indexed
beans in forms, the struts JSP taglibs cannot handle the resulting indexed
messages.  Could this be a bug?  It sure looks that way.

Thanks, 
josh cronemeyer 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Validator's indexedListProperty

Posted by Josh Cronemeyer <jo...@ink.org>.
Hi,

I've been playing with the indexedListProperty to validate what a user has
selected in my forms.  The problem I am having is that when an error message
gets returned, It does not get associated with the form element
(<html:multibox property="test"> in my case).  I think the problem is that
the message comes back with a key of test[x] where x is the index of the
error.  If I just print out my error messages like this <html:errors/> I can
see the error message, but <html:errors property="test"/> doesn't show
anything.  It seems like the <html:errors> tag should have an
indexedListProperty parameter as well so I can display my error messages
correctly.  What am i missing?

Regards,

josh cronemeyer

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Multiple file upload

Posted by Laurie Harper <la...@holoweb.net>.
Parsing the data from the request is all handled for you by Struts. You 
just get a bunch of java.io.File objects to work with.

L.

C.F. Scheidecker Antunes wrote:

> Thanks that's what I thought regarding the form. But what I really want 
> is to know how to separate them when they are uploaded.
> Files are uploaded like email mime attachments. So there is a begining 
> and end of each file. Therefore, how do you separate them?
> I image that you would have to create a FormBean to accept n file inputs 
> and then get the content to each one separately and assign them to a 
> stream class. Checking for each input whether it is null or not.
> 
> Laurie Harper wrote:
> 
>> C.F. Scheidecker Antunes wrote:
>>
>>> Is there any way to perform multiple file uploads using Jakarta 
>>> Commons Upload on a Struts application?
>>> Is there any howto on this issu?
>>
>>
>>
>> Just use multiple file inputs on the form. There's no way to provide a 
>> single 'select multiple files to upload' widget, if that's what you're 
>> asking; HTML only provides the single-file form input. But there's 
>> nothing to stop you having more than one of them on a page.
>>
>> L.


-- 
Laurie Harper
Open Source advocate, Java geek: http://www.holoweb.net/laurie
Founder, Zotech Software: http://www.zotechsoftware.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Multiple file upload

Posted by "C.F. Scheidecker Antunes" <na...@antunes.eti.br>.
Thanks that's what I thought regarding the form. But what I really want 
is to know how to separate them when they are uploaded.
Files are uploaded like email mime attachments. So there is a begining 
and end of each file. Therefore, how do you separate them?
I image that you would have to create a FormBean to accept n file inputs 
and then get the content to each one separately and assign them to a 
stream class. Checking for each input whether it is null or not.

Laurie Harper wrote:

> C.F. Scheidecker Antunes wrote:
>
>> Is there any way to perform multiple file uploads using Jakarta 
>> Commons Upload on a Struts application?
>> Is there any howto on this issu?
>
>
> Just use multiple file inputs on the form. There's no way to provide a 
> single 'select multiple files to upload' widget, if that's what you're 
> asking; HTML only provides the single-file form input. But there's 
> nothing to stop you having more than one of them on a page.
>
> L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Multiple file upload

Posted by Laurie Harper <la...@holoweb.net>.
C.F. Scheidecker Antunes wrote:
> Is there any way to perform multiple file uploads using Jakarta Commons 
> Upload on a Struts application?
> Is there any howto on this issu?

Just use multiple file inputs on the form. There's no way to provide a 
single 'select multiple files to upload' widget, if that's what you're 
asking; HTML only provides the single-file form input. But there's nothing 
to stop you having more than one of them on a page.

L.
-- 
Laurie Harper
Open Source advocate, Java geek: http://www.holoweb.net/laurie
Founder, Zotech Software: http://www.zotechsoftware.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org