struts自带的upload例子中的form<html:form action="upload.do?queryParam=Successful" enctype="multipart/form-data"> Please enter some text, just to demonstrate the handling of text elements as opposed to file elements:<br /> <html:text property="theText" /><br /><br /> Please select the file that you would like to upload:<br /> <html:file property="theFile" /><br /><br /> If you would rather write this file to another file, please check here: <html:checkbox property="writeFile" /><br /><br /> If you checked the box to write to a file, please specify the file path here:<br /> <html:text property="filePath" /><br /><br /> <html:submit /> </html:form>在<html:form... 中是没有method的.
各位老兄们,去掉了method="post"还是不行呀.怎么回事呢?
请问哪里可以找到struts自带的例子啊,我用的struts是JB集成的,里面有例子吗?
有一本 《Struts kick start》里面有一个上传文件的例子可以参考一下
兄弟们快快帮偶解决问题呀,为什么FormFile对象是null呢?
NewsForm newsForm = (NewsForm)form; 改为NewsForm newsForm = new NewsForm();
<html:text property="theText" /><br /><br /> Please select the file that you would like to upload:<br />
<html:file property="theFile" /><br /><br /> If you would rather write this file to another file, please check here:
<html:checkbox property="writeFile" /><br /><br /> If you checked the box to write to a file, please specify the file path here:<br />
<html:text property="filePath" /><br /><br /> <html:submit />
</html:form>在<html:form... 中是没有method的.
改为NewsForm newsForm = new NewsForm();
NewsForm是ActionForm呀,
NewsForm newsForm = (NewsForm)form;这一句不对吗?
为什么要改成NewsForm newsForm = new NewsForm();呢?