GeeCON Prague 2014*
The moose likes Struts and the fly likes Issue with ServletFileUpload when including both Struts1 and struts2 jars in classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Issue with ServletFileUpload when including both Struts1 and struts2 jars in classpath" Watch "Issue with ServletFileUpload when including both Struts1 and struts2 jars in classpath" New topic
Author

Issue with ServletFileUpload when including both Struts1 and struts2 jars in classpath

Sunny chowdhary
Greenhorn

Joined: Feb 08, 2011
Posts: 1
Hi All,

My application is on Struts1. Later on I have included Struts2 to use its advanced features.

I have written following code to parse the request object which runs perfectly fine on Struts1 -

F

I am getting all request items in this list when I am using only Struts1 in my application.

I debugged and found out that when I included struts2-core-2.2.1.1.jar in my application's classpath, this list is returned as empty. The above mentioned code stopped working after I included struts2-core-2.2.1.1.jar to use Struts2 features in application.

I am not able to find out the relation of this code with struts1 and struts2 jars as the above classes are from commons-fileupload-1.1.jar.

Any help will be greatly appreciated.


Thanks & Regards,
Sunny Choudhary
Frank Otto
Greenhorn

Joined: Aug 19, 2011
Posts: 2
Hi,

I have the same problem with struts upload and struts2. Have you find a solution?


kind regards,

F.O.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Friend, it's simplified in sturts 2 there is one interceptor called fileUploadInterceptor it's responsible for file uploading. Follow the link http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/FileUploadInterceptor.html clearly explained here.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Frank Otto
Greenhorn

Joined: Aug 19, 2011
Posts: 2
I have struts 1 upload action, but if I include struts2 in my app, the upload will not work. Without struts2 it works perfectly.
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

If you want migrate your app from struts 1 to struts 2 change your action class struts 2 style or else stick to struts 1. By adding the jar file you will not get struts2 capabilities.
 
GeeCON Prague 2014
 
subject: Issue with ServletFileUpload when including both Struts1 and struts2 jars in classpath