新手:Struts框架下完成文件上传功能, 这个报错怎么办?

05-05-18 nxing
jsp:

html:form action="/articleUploadAction.do?action=post" method="post" enctype="multipart/form-data" onsubmit="return checkForm(this)

html:file property="fileName" styleClass="input_postarticle"

actionform:

private String fileName;

public String getFileName()

{

return fileName;

}

public void setFileName(String s)

{

fileName = s;

}

报错

exception

javax.servlet.ServletException: BeanUtils.populate

org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)

org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:763)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause

java.lang.IllegalArgumentException: argument type mismatch

sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

java.lang.reflect.Method.invoke(Method.java:324)

org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)

org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)

org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)

org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)

org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)

org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)

org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

javax.servlet.http.HttpServlet.service(HttpServlet.java:763)

javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

这个怎么办?恳请指教!

banq
2005-05-25 08:30
关键是: argument type mismatch

参数类型不配匹

猜你喜欢