Hi,
I have created file upload.jsp:
<%@ page contentType="text/html; charset=ISO-8859-2" %>
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html:html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2">

<META NAME="Author" CONTENT="Bartlomiej Pawlowski">
<title>upload</title>
</head>
<body>
  <html:form action="/upload" >
   File <html:file property="file" maxlength="30" styleClass="form2"/>
   <html:submit>Upload</html:submit>
  </html:form>
</body>
</html:html>
and ActionForm bean:
public class UploadForm extends ActionForm {

    private FormFile file;
    public UploadForm() {
    }

    public void setFile(FormFile file) {
        this.file = file;
    }
    public FormFile getFile() {
        return file;
    }
}

when I submit this form I receive following exception:

Internal Servlet Error:

javax.servlet.ServletException: BeanUtils.populate
 at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:486)
 at
org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:1910)

 at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521)

Root cause:
java.lang.IllegalArgumentException: argument type mismatch
 at java.lang.reflect.Method.invoke(Native Method)
 at
org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:825)

 at
org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:756)

 at
org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:782)

What is wrong?
Who can help me?

Reply via email to