你的表单的提交方式要改成POST提交(METHOD="POST")
还有当你用了<html:file>标签时,你的表单的标签也必须是struts的<html:form>标签
还有当你用了<html:file>标签时,你的表单的标签也必须是struts的<html:form>标签
解决方案 »
- 500分求 snmp agent的详细开发
- S2SH 关键字查询怎么实现?
- 求一个swing程序
- java mail 如何发送多 content-type邮件
- 高分求教acegi session过期问题
- 关于Session
- 请问如何用struts上传多个多个文件??
- 关于struts的配置问题,不要灌水
- Struts自定义组件的问题.
- 在写servlet时连接数据库出现No operations allowed after connection closed
- 请问eclipse生成webservice客户端的告警问题
- newxy(新坐标)升级至1.02版,增加了文件上传至服务器文件夹的功能,增加了两个用于转发的标签.有用过newxy的吗?
如果没找到BEAN我没见到过这个异常,上次也是出了这个错误
是没有enctype="multipart/form-date",这次倒不行了,真郁闷!
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/newxy-html.tld" prefix="nhtml"%>
<%@ taglib uri="/WEB-INF/newxy-logic.tld" prefix="nlogic"%><nlogic:action1 id="act1" formName="fileForm"/>
<nhtml:form action="" formName="fileForm" enctype="multipart/form-data">
文件夹:<input type="text" name="_directory" size="40"/><br />
文件1,不大于1024K:<nhtml:file property="file1" size="40" maxSize="1024"/><br />
文件2,不大于1024K:<nhtml:file property="file2" size="40" maxSize="1024"/><br />
</nhtml:form>
<nhtml:button actionId="act1" method="upload"/>2.上传文件到数据库中的方法:
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/newxy-html.tld" prefix="nhtml"%>
<%@ taglib uri="/WEB-INF/newxy-logic.tld" prefix="nlogic"%><nlogic:action1 id="act1" formName="fileForm"/>
<nhtml:form action="" formName="fileForm" enctype="multipart/form-data">
数据库表名:<input type="text" name="_table" size="40"/><br />
说明:<input type="text" name="explain" size="40"/><br />
文件1,不大于1024K:<nhtml:file property="file1" size="40" maxSize="1024"/><br />
文件2,不大于1024K:<nhtml:file property="file2" size="40" maxSize="1024"/><br />
</nhtml:form>
<nhtml:button actionId="act1" method="update"/>这两种方法是不是最简单的,而且很相似。大家帮忙比较,找到更简单的方法送50分。
newxy技术网站:http://www.newxy.net
有关文件上传:
文件上传至文件夹: http://www.newxy.net/doc.jsp#anchor15.1
文件上传至数据库: http://www.newxy.net/doc.jsp#anchor15.2
文件上传至文件夹与上传至数据库的比较:http://www.newxy.net/doc.jsp#anchor15.3
有关范例:
http://www.newxy.net/zh_cn/samples/sample2/demo.jsp