File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem with enctype attribute in jsp" Watch "problem with enctype attribute in jsp" New topic

problem with enctype attribute in jsp

venkateshwar rao ravula

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.

Ben Souther

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.

Consultant, Sima Solutions
I agree. Here's the link:
subject: problem with enctype attribute in jsp
It's not a secret anymore!