Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: Empty request parameters with enctype set to "multipart/form-data"

Andrew Stepanenko

2007-02-15

Replies:

Hello,

http://www.archivum.info/user@(protected)

Regards,
Andrew Stepanenko

On 2/15/07, Karsten Voges <karsten.voges@(protected):
> Hi list,
>
> I downloaded Struts 2.0.5 (beta) and started developing of a small app
> (simple form submit) on Tomcat 5.5.17 (JDK 1.5). Its working quite good
> and I am happy with both the stability and the programming model.
>
> Unfortunately I have a problem with some requests (form submitting)
> sending no request parameters at all (empty enumeration) and setting no
> fields of my actions. This mainly happens the first time the form gets
> submitted and mainly.
> When I set the enctype parameter in the s:form with enctype =
> "application/x-www-form-urlencoded" the form gets submitted without a
> problem. All request parameters are set (checked via
> ServletActionContext.getRequest().getParameterNames()), all fields in
> the action are populated.
> But to upload files I have to set the enctype to "multipart/form-data" :(
>
> I found the following questions with the same problem, but no solution
> so far:
> http://www.junlu.com/msg/309344.html
> http://www.archivum.info/user@(protected)
>
> I have not special interceptors in place.
> When no parameters are set, the fileinterceptor is not cleaning the tmp
> files, if the request is coming in well, the fileinterceptor is logging
> as well.
>
> Of course I could seperate the rest of the form from the upload, but I
> am not to sure if this would work either.
> I copied all the code over from struts2-showcase-2.0.5 regarding the
> fileupload and it is working most of the times, but not 100%.
>
> The strange thing, is that it mainly happens the first time I submit,
> but not the following times, but sometimes it also happens a second or
> third time.
> It never happens after it worked once, so after the form submit worked
> once fine it works fine always.
>
> Any help much appreciated.
> Thanks,
> Karsten.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.