struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barłomiej Pawłowski <bpawlow...@supermedia.pl>
Subject problem with upload file
Date Fri, 03 Aug 2001 11:36:25 GMT
Hi
I have created multipart form:

<%@ 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>Test uploadu</title>
</head>
<body>
<h1>Próba uploadu</h1>
<h2> Konsola administracyjna </h2>
<br>
  <html:form action="/upload" >
   File <html:file property="file" />
   <html:submit>Upload</html:submit>
  </html:form>
</body>
</html:html>
next ActionForm bean:

public class UploadForm extends ActionForm {

    private FormFile myFile;
    public UploadForm() {
    }

    public void setMyFile(FormFile file) {
        this.myFile = file;
    }
    public FormFile getMyFile() {
        return myFile;
    }

}

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)
 at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

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)

 at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:541)

why?
who can help me?



Mime
View raw message