#########一个关于FormFile为空的问题########### <input type="file" name="theFile"/> 改成 <input type="file" name="file"/> 或者private FormFile file; 改成private FormFile theFile; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 改了,但出现以下异常:java.lang.IllegalArgumentException: Cannot invoke com.test.form.TestForm.setTheFile - argument type mismatch org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1778) org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759) org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648) org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677) org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022) org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)........百度了一下说是表单file与ActionForm里的FomrFile不一致... up~我和LZ碰到了相同的问题~哪位高手解答一下~~~ 当然了,你一定要把<form>里的原素改成和formbean里面的属性一样,不原的话是取不到值的!!!!一定要改成一样! <input type="file" name="theFile"/> 改成<html:file property="file"/><html:form action="test.do" name="testForm" enctype="multipart/form-data"> <center> <font style="font-size:12px;color:red">请选择需要上传的照片 : </font> <html:file property="file"/> <html:submit property="submit"/></center> </html:form> <input type="file" name="theFile"/>要改成<input type="file" name="file"/>别倒过来改 private FormFile file; <input type="file" name="theFile"/> 这当然取不到了。7楼给出答案了 在form后加上 enctype="multipart/form-data" 你那个标签用的不对,你必须用struts自己的html<html:text>标签。才能把控件里的值给你封装成对象,如果还用原来的<html>标签,在action里当然取不到 纯java连接数据库方式的固定语法小问题 JSP不能正常編譯 jdk1.2的class(没有原码),在jdk1.4环境不支持,怎么办呢,先谢谢大家 如让梅花雪控件中一个节点字体颜色变成红色? tomcat出错!! 在struts1的action中获取的页面表单数据 JSP页面,已知服务器端文件流,如何弹出一个下载文件的对话框,并返回所选路径??? 如何实现用户的权限管理。(高分答谢) 请求,怎样实现jsp的b/s下的客户端打印? 谁能帮我把C写的函数转成javascript语言 使用java组件动态读写word文件 strturs2 国际化中使用占位符的问题
org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1778)
org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)
org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
........百度了一下说是表单file与ActionForm里的FomrFile不一致...
我和LZ碰到了相同的问题~
哪位高手解答一下~~~
一定要改成一样!
<center>
<font style="font-size:12px;color:red">请选择需要上传的照片 : </font>
<html:file property="file"/>
<html:submit property="submit"/>
</center>
</html:form>
<input type="file" name="file"/>别倒过来改