You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rubbinio <rs...@n-able.com> on 2008/04/22 17:46:58 UTC

Struts 1 & Struts 2 file upload problem

Hi,

we have an old application written in Struts 1 and we started adding new
features in Struts 2. In the old application we had a file upload form which
was working fine.

After adding Struts 2, the form does not work anymore because the file field
is not populated in the form anymore and it is always null.

In the sever console we can see : org.apache.struts2.dispatcher.Dispatcher
getSaveDir which does not show up if Struts 2 is removed.

Is there any way to have both file uploads ( Struts 1 and 2 ) working in
parallel ? And if yes how ? If not how can we disable the Struts 2 file
upload ?

Thanks


-- 
View this message in context: http://www.nabble.com/Struts-1---Struts-2-file-upload-problem-tp16824755p16824755.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts 1 & Struts 2 file upload problem

Posted by Radu Solomon <rs...@n-able.com>.
Thank you.

You were absolutely right. our struts 2 filter was using /* and the 
Struts 1 servlet mapping *.do. Once I changed the struts 2 to *.action 
it all went back to normal.



Laurie Harper wrote:
> Rubbinio wrote:
>> Hi,
>>
>> we have an old application written in Struts 1 and we started adding new
>> features in Struts 2. In the old application we had a file upload 
>> form which
>> was working fine.
>>
>> After adding Struts 2, the form does not work anymore because the 
>> file field
>> is not populated in the form anymore and it is always null.
>>
>> In the sever console we can see : 
>> org.apache.struts2.dispatcher.Dispatcher
>> getSaveDir which does not show up if Struts 2 is removed.
>>
>> Is there any way to have both file uploads ( Struts 1 and 2 ) working in
>> parallel ? And if yes how ? If not how can we disable the Struts 2 file
>> upload ?
>
> These should be able to co-exist without problem. You need to include 
> details of your configuration; I suspect you have your Struts 1 
> servlet mapping and Struts 2 filter mapping configured in such a way 
> as to cause both to be invoked on the same request. Since multi-part 
> request parsing is handled by Struts, not the container, this could 
> well cause a conflict.
>
> If that's not what you've done, or you fix that and still have the 
> same problem, re-post with complete details of your relevant 
> configuration (including web.xml, struts.xml and struts-config.xml 
> excerpts at least) so we have enough information to help.
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

Re: Struts 1 & Struts 2 file upload problem

Posted by Laurie Harper <la...@holoweb.net>.
Rubbinio wrote:
> Hi,
> 
> we have an old application written in Struts 1 and we started adding new
> features in Struts 2. In the old application we had a file upload form which
> was working fine.
> 
> After adding Struts 2, the form does not work anymore because the file field
> is not populated in the form anymore and it is always null.
> 
> In the sever console we can see : org.apache.struts2.dispatcher.Dispatcher
> getSaveDir which does not show up if Struts 2 is removed.
> 
> Is there any way to have both file uploads ( Struts 1 and 2 ) working in
> parallel ? And if yes how ? If not how can we disable the Struts 2 file
> upload ?

These should be able to co-exist without problem. You need to include 
details of your configuration; I suspect you have your Struts 1 servlet 
mapping and Struts 2 filter mapping configured in such a way as to cause 
both to be invoked on the same request. Since multi-part request parsing 
is handled by Struts, not the container, this could well cause a conflict.

If that's not what you've done, or you fix that and still have the same 
problem, re-post with complete details of your relevant configuration 
(including web.xml, struts.xml and struts-config.xml excerpts at least) 
so we have enough information to help.

L.


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