struts2 上传文件相关
来源:互联网 发布:在淘宝买薄荷种子 编辑:程序博客网 时间:2024/06/05 08:54
类中
- private File filedata; // 与jsp表单中的名称对应
- private String filedataFileName; // FileName为固定格式
- private String filedataContentType; // ContentType为固定格式
jsp中
<form id="formID" action="${ctx}/system/contractDocument!add.action" method="post" class="validation" enctype="multipart/form-data">
<s:token></s:token>
<s:hidden name="contractDocument.id"></s:hidden>
<table class="ntable" width="900px">
<tr class="tr0">
<td class="rtd" width="80">文件</td>
<td width="370">
<s:file name="filedata"></s:file>
</td>
<td class="rtd" width="80">备注</td>
<td><s:textfield name="contractDocument.bz"></s:textfield></td>
</tr>
</table>
<input type="submit" id="save" value="保存" class="btn1"/>
</form>
需要注意
1.enctype="multipart/form-data" 不能忘记填写
2.页面中<s:file name="filedata"></s:file> 中name名称必须与类中的一致
0 0
- struts2 上传文件相关
- struts2文件上传相关资料收集整合
- struts2 文件上传相关问题剖析
- Struts2中上传文件相关设置
- Struts2上传文件及相关总结
- struts2上传文件(三) struts2上传文件
- [Struts2]Struts2的文件上传
- Struts2的文件上传
- Struts2文件上传
- Struts2 上传文件实例
- struts2文件上传
- struts2文件上传
- Struts2的文件上传
- struts2-上传文件(1)
- struts2-上传文件(2)
- Struts2上传文件示例
- struts2文件上传
- Struts2实现文件上传
- Android图片加载缓存框架Glide
- Android xposed框架开发入门
- java队列的链表实现
- 蓝桥杯:基础练习 回形取数
- c++ string 类的实现
- struts2 上传文件相关
- 模糊查询
- 通过http cache来避免频繁调用接口
- nyoj 88 汉诺塔 (快速模幂法)
- java 微信等三方登录部署到WAS服务器上报错
- Ubuntu文件浏览器 - 开发Scope/应用利器
- poj 1000
- Java过滤器与SpringMVC拦截器之间的关系与区别
- 堆栈(Stack)在后缀表达式中的应用