使用struts文件上传标签时报 argument type mismatch
使用struts文件上传标签时报 argument type mismatch
1.必须在html:form 中加上如下 enctype="multipart/form-data"
2.要把method改成post
EG:
FROM:
public class CustomerForm extends ActionForm {
FormFile file;
public FormFile getFile() {
return file;
}
public void setFile(FormFile file) {
this.file = file;
}
}
JSP:
<form action="/admin/customer.do" method="post" enctype="multipart/form-data">
<input type="file" name="file"/>
ACTION:
FormFile filedata = customerForm.getFile();