Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sunny chowdhary
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Frank Otto
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic