This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Struts2 file upload resets form if maxsize exceeds Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Struts2 file upload resets form if maxsize exceeds" Watch "Struts2 file upload resets form if maxsize exceeds" New topic
Author

Struts2 file upload resets form if maxsize exceeds

Pious Francis
Greenhorn

Joined: Jun 25, 2004
Posts: 11
I am uploading a file using the struts2 file uploder. In struts.xml I set struts.multipart.maxSize to 1 MB. If the file limit exceeds after import, my form data is reset and all user inputs are appearing as blank (I have some text fields along with the file upload control). In the logs I am getting the error 'The request was rejected because its size exceeds the configured maximum' which is expected. I am printing the action errors in JSP and this message is printed in the JSP , which is again as expected.
But why my form data is getting reset?

Another point is if I set maxSize in the fileUpload interceptor it works fine, I am getting errors message with form data kept as it is. The issue is only with the struts2 struts.multipart.maxSize setting in the struts.xml. According to my observation struts.multipart.maxSize takes precedence than the interceptor maxsize setting, so I need to set a upload limit in struts.multipart.maxSize.
And other xml basesd struts validations are working fine for me, where I get validation errors printed on page, but form data is not lost after validation run.

Anybody faced this issue .. Can somebody help to resolve this? Any suggestions appreciated.....
 
I agree. Here's the link: jrebel
 
subject: Struts2 file upload resets form if maxsize exceeds
 
Similar Threads
struts2 problem
Struts2 & validation [SOLVED]
Struts2 & XmlHttpRequest & input_file & Html5
Struts2 File Upload Maximum Size
Struts2: file upload not working