struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lowe <mark.l...@talk21.com>
Subject Re: multipart problem
Date Wed, 11 Feb 2004 14:09:10 GMT
You can do all the work in one action, just don't do the image stuff if 
there's not one present.

int imageLength = image.getFileData().length;

if(imageLength > 0) {
	//do the image stuff.
}


On 11 Feb 2004, at 14:57, Turner Benjamin wrote:

>
> hi,
>
> well i have an action that compiles all the data necessary for a page 
> (presents a newsletter being created), newsletter.do. i also have an 
> action that attaches an image to the newsletter (image.do), which 
> after putting the image in the db as a blob forwards control back to 
> newsletter.do to reload the newsletter and show it.
>
> without the multipart spec the code works (but of course i can't 
> upload a file), and the chain forwarding to the other action works as 
> well.
>
> cheers,
>
> Ben
>
> -----Original Message-----
> From: Joe Germuska [mailto:Joe@Germuska.com]
> Sent: 11 februari 2004 14:39
> To: Struts Users Mailing List
> Subject: Re: multipart problem
>
> When you forward to a second action, you re-invoke the entire request
> processing chain, which means that you get a new form object created,
> etc.  This is why you'll frequently see recommendations against
> "action chaining."  Of course, if you get rid of the form encoding,
> you won't be able to do file upload at all, so that's not
>
> Are you sure that forwarding to a second action is the only way to
> process the data?  Perhaps you can rearrange things to avoid
> re-invoking the request processor.
>
> Joe
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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


Mime
View raw message