*
The moose likes Struts and the fly likes problem with enctype attribute in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with enctype attribute in jsp" Watch "problem with enctype attribute in jsp" New topic
Author

problem with enctype attribute in jsp

venkateshwar rao ravula
Greenhorn

Joined: Apr 03, 2006
Posts: 15
Hi everybody,

I am trying to upload the file using struts,if i use the enctype="multipart/form-data" attribute in the jsp iam getting following error.

[[action]] Servlet.service() for servlet action threw exception
java.lang.NoSuchMethodError: org.apache.commons.fileupload.FileUpload.setSizeMax(I)V

please help me to come out of thi problem.

Thanks
Rvrao
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

We have a Struts specific forum.
I'll move this thread to that forum for you.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Here are some things to check:

1-Make sure that there is a commons-fileupload.jar file in your WEB-INF/lib directory and make sure it's the one that came with the same Struts download as your struts.jar file.

2-Make sure that you don't have any commons-xxx.jar files in common lib directories used by all applications. This would cause it to be loaded by a different ClassLoader than strus, and could cause problems.

If you've verified the above and are still getting the error, post your JSP code (at least the <html:form> tag and the <html:file> tags) as well as the relevant portions of your struts-config.xml file and your ActionForm bean. We'll then have more information to help you solve this.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with enctype attribute in jsp
 
Similar Threads
html:form enctype="multipart/form-data"
how to pass values from html to jsp
multipart form/data- form field
Action form is not populated while using html:form enctype="multipart/form-data"
Http error status 405