| Author |
Beanutils.populate error with file upload control
|
Rahul Vhatkar
Greenhorn
Joined: Aug 24, 2009
Posts: 9
|
|
I have following code in my jsp:
<html:file property="theFile" size="40" accept="text/plain"/>
I also have setters and getters in my form bean:
public FormFile getTheFile() {
return theFile;
}
public void setTheFile(FormFile theFile) {
try {
this.theFile = theFile;
} catch(Exception e) {
System.out.println("error " + e);
}
}
But when I submit the form, I get Beanutils.populate error.
javax.servlet.ServletException: BeanUtils.populate
When I remove the html:file control from the jsp, then it works fine.
Any ideas?
|
 |
Rahul Vhatkar
Greenhorn
Joined: Aug 24, 2009
Posts: 9
|
|
The BeanUtils error goes away when I add enctype="multipart/form-data" to my html:form tag in the jsp.
But the control does not go to the action class which should be called when the form is submitted. Instead it goes back to the previous jsp.
Can anybody please help?
|
 |
debraj mallick
Ranch Hand
Joined: Mar 08, 2011
Posts: 188
|
|
Hi Rahul,
could you put some code, so that we could understand,
also, are you using struts 2 or struts 1?
|
 |
 |
|
|
subject: Beanutils.populate error with file upload control
|
|
|