You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Alex Siman <al...@gmail.com> on 2009/10/14 01:58:34 UTC

Bug: Struts 2.1.8 and "multipart/form-data"

If form uses [enctype="multipart/form-data"] then Struts2 stores request
params in session (I suppose, at least not in request). And with every form
submit Struts2 prepend prev value of parameter to a new one separated by a
comma.

Example:

update.jsp
----------------------
	<s:form action="upload" enctype="multipart/form-data">
		...
		<s:textfield name="desc" label="Description"/>
		...
	</s:form>
----------------------

Suppose we have submited form multiple times:
1) set "desc" to "1", then "desc" will be "1".
2) set "desc" to "2", then "desc" will be "1, 2".
3) set "desc" to "3", then "desc" will be "1, 2, 3".
...
n) set "desc" to "n", then "desc" will be "1, 2, 3 ... , n-1, n".
	
This issue appeared after I upgraded to Struts 2.1.8:
- ognl-2.7.3.jar
- struts2-core-2.1.8.jar
- struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar
- xwork-core-2.1.6.jar

Is this bug or feature? How to fix this?
-- 
View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25883021.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Dale Newfield <da...@newfield.org>.
Alex Siman wrote:
> I use [2.1.8]. Just read the version of Struts in a Subject of this thread.

Whoops--my bad.

-Dale

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


Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Alex Siman <al...@gmail.com>.
I use [2.1.8]. Just read the version of Struts in a Subject of this thread.
Additionally I listed versions of Struts related JARs in first message.

DNewfield wrote:
> 
>>> Alex Siman wrote:
>>>> The issue has gone away, after I removed plugin
>>>> [struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar]. But this plugin works
>>>> correctly w/ Struts 2.1.6.
> 
> And how about 2.1.8?  If you haven't event checked it against the 
> released version it's not fair to make someone else go track it down for 
> you.
> 
> -Dale
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25906912.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Dale Newfield <da...@newfield.org>.
>> Alex Siman wrote:
>>> The issue has gone away, after I removed plugin
>>> [struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar]. But this plugin works
>>> correctly w/ Struts 2.1.6.

And how about 2.1.8?  If you haven't event checked it against the 
released version it's not fair to make someone else go track it down for 
you.

-Dale

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


Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Wes Wannemacher <we...@wantii.com>.
I haven't looked at it in a while :(

Sorry, but Martin's right (did I just type that, I need to go wash my hands

...

Okay, so put in the stack trace and maybe link to this thread on
nabble and I'll take a look as soon as I can.

-Wes

On Wed, Oct 14, 2009 at 9:08 PM, Alex Siman <al...@gmail.com> wrote:
>
> Wes Wannemacher, what is wrong w/ this file upload plugin and Struts 2.1.8?
>
> Alex Siman wrote:
>>
>> The issue has gone away, after I removed plugin
>> [struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar]. But this plugin works
>> correctly w/ Struts 2.1.6.
>>
>
> --
> View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25900848.html
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Alex Siman <al...@gmail.com>.
Wes Wannemacher, what is wrong w/ this file upload plugin and Struts 2.1.8?

Alex Siman wrote:
> 
> The issue has gone away, after I removed plugin
> [struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar]. But this plugin works
> correctly w/ Struts 2.1.6.
> 

-- 
View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25900848.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


RE: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Martin Gainty <mg...@hotmail.com>.
Alex-

can you file a big report with stacktrace/log and plugin configuration files 
https://issues.apache.org/struts/secure/Dashboard.jspa

thanks,
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Wed, 14 Oct 2009 17:54:07 -0700
> From: aleksandr.siman@gmail.com
> To: dev@struts.apache.org
> Subject: Re: Bug: Struts 2.1.8 and "multipart/form-data"
> 
> 
> The issue has gone away, after I removed plugin
> [struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar]. But this plugin works
> correctly w/ Struts 2.1.6.
> 
> Alex Siman wrote:
> > 
> > If form uses [enctype="multipart/form-data"] then Struts2 stores request
> > params in session (I suppose, at least not in request). And with every
> > form submit Struts2 prepend prev value of parameter to a new one separated
> > by a comma.
> > 
> > Example:
> > 
> > update.jsp
> > ----------------------
> > 	<s:form action="upload" enctype="multipart/form-data">
> > 		...
> > 		<s:textfield name="desc" label="Description"/>
> > 		...
> > 	</s:form>
> > ----------------------
> > 
> > Suppose we have submited form multiple times:
> > 1) set "desc" to "1", then "desc" will be "1".
> > 2) set "desc" to "2", then "desc" will be "1, 2".
> > 3) set "desc" to "3", then "desc" will be "1, 2, 3".
> > ...
> > n) set "desc" to "n", then "desc" will be "1, 2, 3 ... , n-1, n".
> > 	
> > This issue appeared after I upgraded to Struts 2.1.8:
> > - ognl-2.7.3.jar
> > - struts2-core-2.1.8.jar
> > - struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar
> > - xwork-core-2.1.6.jar
> > 
> > Is this bug or feature? How to fix this?
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25900845.html
> Sent from the Struts - Dev mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141665/direct/01/

Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Alex Siman <al...@gmail.com>.
The issue has gone away, after I removed plugin
[struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar]. But this plugin works
correctly w/ Struts 2.1.6.

Alex Siman wrote:
> 
> If form uses [enctype="multipart/form-data"] then Struts2 stores request
> params in session (I suppose, at least not in request). And with every
> form submit Struts2 prepend prev value of parameter to a new one separated
> by a comma.
> 
> Example:
> 
> update.jsp
> ----------------------
> 	<s:form action="upload" enctype="multipart/form-data">
> 		...
> 		<s:textfield name="desc" label="Description"/>
> 		...
> 	</s:form>
> ----------------------
> 
> Suppose we have submited form multiple times:
> 1) set "desc" to "1", then "desc" will be "1".
> 2) set "desc" to "2", then "desc" will be "1, 2".
> 3) set "desc" to "3", then "desc" will be "1, 2, 3".
> ...
> n) set "desc" to "n", then "desc" will be "1, 2, 3 ... , n-1, n".
> 	
> This issue appeared after I upgraded to Struts 2.1.8:
> - ognl-2.7.3.jar
> - struts2-core-2.1.8.jar
> - struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar
> - xwork-core-2.1.6.jar
> 
> Is this bug or feature? How to fix this?
> 

-- 
View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25900845.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Alex Siman <al...@gmail.com>.
Yes, I use scope="prototype". If I just remove "multipart/form-data" from the
HTML markup, then action works correct. I added "helperField" w/o
getters/setters, and its value are changed w/ every request, not preppending
for this field. Seems like debugging needed.

Musachy Barroso wrote:
> 
> are you sure that a new instance of your action is created everytime,
> like if using spring, scope="prototype"?
> 
> musachy
> 
> On Wed, Oct 14, 2009 at 2:20 AM, Alex Siman <al...@gmail.com>
> wrote:
>>
>> Yes, it is very strange behaviour...
>>
>> Say action with "multipart/form-data" is named UploadAction. And we have
>> another action AnotherAction. If we execute UploadAction couple times,
>> then
>> execute AnotherAction, and then again return to UploadAction the all
>> properties of it will be prepended with previously entered values. WTF.
>>
>> Musachy Barroso wrote:
>>>
>>> why do you think it stores them in the session? that sounds weird.
>>>
>>> musachy
>>>
>>> On Tue, Oct 13, 2009 at 4:58 PM, Alex Siman <al...@gmail.com>
>>> wrote:
>>>>
>>>> If form uses [enctype="multipart/form-data"] then Struts2 stores
>>>> request
>>>> params in session (I suppose, at least not in request). And with every
>>>> form
>>>> submit Struts2 prepend prev value of parameter to a new one separated
>>>> by
>>>> a
>>>> comma.
>>>>
>>>> Example:
>>>>
>>>> update.jsp
>>>> ----------------------
>>>>        <s:form action="upload" enctype="multipart/form-data">
>>>>                ...
>>>>                <s:textfield name="desc" label="Description"/>
>>>>                ...
>>>>        </s:form>
>>>> ----------------------
>>>>
>>>> Suppose we have submited form multiple times:
>>>> 1) set "desc" to "1", then "desc" will be "1".
>>>> 2) set "desc" to "2", then "desc" will be "1, 2".
>>>> 3) set "desc" to "3", then "desc" will be "1, 2, 3".
>>>> ...
>>>> n) set "desc" to "n", then "desc" will be "1, 2, 3 ... , n-1, n".
>>>>
>>>> This issue appeared after I upgraded to Struts 2.1.8:
>>>> - ognl-2.7.3.jar
>>>> - struts2-core-2.1.8.jar
>>>> - struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar
>>>> - xwork-core-2.1.6.jar
>>>>
>>>> Is this bug or feature? How to fix this?
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25883021.html
>>>> Sent from the Struts - Dev mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25887830.html
>> Sent from the Struts - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25893802.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Musachy Barroso <mu...@gmail.com>.
are you sure that a new instance of your action is created everytime,
like if using spring, scope="prototype"?

musachy

On Wed, Oct 14, 2009 at 2:20 AM, Alex Siman <al...@gmail.com> wrote:
>
> Yes, it is very strange behaviour...
>
> Say action with "multipart/form-data" is named UploadAction. And we have
> another action AnotherAction. If we execute UploadAction couple times, then
> execute AnotherAction, and then again return to UploadAction the all
> properties of it will be prepended with previously entered values. WTF.
>
> Musachy Barroso wrote:
>>
>> why do you think it stores them in the session? that sounds weird.
>>
>> musachy
>>
>> On Tue, Oct 13, 2009 at 4:58 PM, Alex Siman <al...@gmail.com>
>> wrote:
>>>
>>> If form uses [enctype="multipart/form-data"] then Struts2 stores request
>>> params in session (I suppose, at least not in request). And with every
>>> form
>>> submit Struts2 prepend prev value of parameter to a new one separated by
>>> a
>>> comma.
>>>
>>> Example:
>>>
>>> update.jsp
>>> ----------------------
>>>        <s:form action="upload" enctype="multipart/form-data">
>>>                ...
>>>                <s:textfield name="desc" label="Description"/>
>>>                ...
>>>        </s:form>
>>> ----------------------
>>>
>>> Suppose we have submited form multiple times:
>>> 1) set "desc" to "1", then "desc" will be "1".
>>> 2) set "desc" to "2", then "desc" will be "1, 2".
>>> 3) set "desc" to "3", then "desc" will be "1, 2, 3".
>>> ...
>>> n) set "desc" to "n", then "desc" will be "1, 2, 3 ... , n-1, n".
>>>
>>> This issue appeared after I upgraded to Struts 2.1.8:
>>> - ognl-2.7.3.jar
>>> - struts2-core-2.1.8.jar
>>> - struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar
>>> - xwork-core-2.1.6.jar
>>>
>>> Is this bug or feature? How to fix this?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25883021.html
>>> Sent from the Struts - Dev mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: dev-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25887830.html
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Alex Siman <al...@gmail.com>.
Yes, it is very strange behaviour...

Say action with "multipart/form-data" is named UploadAction. And we have
another action AnotherAction. If we execute UploadAction couple times, then
execute AnotherAction, and then again return to UploadAction the all
properties of it will be prepended with previously entered values. WTF.

Musachy Barroso wrote:
> 
> why do you think it stores them in the session? that sounds weird.
> 
> musachy
> 
> On Tue, Oct 13, 2009 at 4:58 PM, Alex Siman <al...@gmail.com>
> wrote:
>>
>> If form uses [enctype="multipart/form-data"] then Struts2 stores request
>> params in session (I suppose, at least not in request). And with every
>> form
>> submit Struts2 prepend prev value of parameter to a new one separated by
>> a
>> comma.
>>
>> Example:
>>
>> update.jsp
>> ----------------------
>>        <s:form action="upload" enctype="multipart/form-data">
>>                ...
>>                <s:textfield name="desc" label="Description"/>
>>                ...
>>        </s:form>
>> ----------------------
>>
>> Suppose we have submited form multiple times:
>> 1) set "desc" to "1", then "desc" will be "1".
>> 2) set "desc" to "2", then "desc" will be "1, 2".
>> 3) set "desc" to "3", then "desc" will be "1, 2, 3".
>> ...
>> n) set "desc" to "n", then "desc" will be "1, 2, 3 ... , n-1, n".
>>
>> This issue appeared after I upgraded to Struts 2.1.8:
>> - ognl-2.7.3.jar
>> - struts2-core-2.1.8.jar
>> - struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar
>> - xwork-core-2.1.6.jar
>>
>> Is this bug or feature? How to fix this?
>> --
>> View this message in context:
>> http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25883021.html
>> Sent from the Struts - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25887830.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


Re: Bug: Struts 2.1.8 and "multipart/form-data"

Posted by Musachy Barroso <mu...@gmail.com>.
why do you think it stores them in the session? that sounds weird.

musachy

On Tue, Oct 13, 2009 at 4:58 PM, Alex Siman <al...@gmail.com> wrote:
>
> If form uses [enctype="multipart/form-data"] then Struts2 stores request
> params in session (I suppose, at least not in request). And with every form
> submit Struts2 prepend prev value of parameter to a new one separated by a
> comma.
>
> Example:
>
> update.jsp
> ----------------------
>        <s:form action="upload" enctype="multipart/form-data">
>                ...
>                <s:textfield name="desc" label="Description"/>
>                ...
>        </s:form>
> ----------------------
>
> Suppose we have submited form multiple times:
> 1) set "desc" to "1", then "desc" will be "1".
> 2) set "desc" to "2", then "desc" will be "1, 2".
> 3) set "desc" to "3", then "desc" will be "1, 2, 3".
> ...
> n) set "desc" to "n", then "desc" will be "1, 2, 3 ... , n-1, n".
>
> This issue appeared after I upgraded to Struts 2.1.8:
> - ognl-2.7.3.jar
> - struts2-core-2.1.8.jar
> - struts2-fileupload-plugin-2.1.7-SNAPSHOT.jar
> - xwork-core-2.1.6.jar
>
> Is this bug or feature? How to fix this?
> --
> View this message in context: http://www.nabble.com/Bug%3A-Struts-2.1.8-and-%22multipart-form-data%22-tp25883021p25883021.html
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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