类名:Ext.form.AttachField
扩展自:Ext.form.TriggerField
功能描述:能够处理多个附件的本地上传、删除、浏览,支持进度显示
如何部署:
-------------s端----------------------
预备工作:建立Web工程,增加dwr支持
1.将附件源码net.bar的java类加入你的Web工程
2.在web.xml加入以下定义
<servlet><init-param>
xml 代码
- <servlet>
- <servlet-name>fileupload</servlet-name>
- <servlet-class>net.bat.upload.uploadServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- <init-param>
- <param-name>path</param-name>
- <param-value>d:/upload/</param-value>
- </init-param>
- <init-param>
- <param-name>tpPath</param-name>
- <param-value>d:/</param-value>
- </init-param>
- </servlet>
</init-param>
</servlet>
3.将类TaskCenter通过dwr开放给B端,以支持进度显示
例如,我的dwr集成到spring下,相应的配置为
<create creator="spring" javascript="TC"><include method="newTask"><include method="getTotal"><include method="getCur">
xml 代码
- <create creator="spring" javascript="TC">
- param name="beanName" value="TaskCenter"/>
- <include method="newTask"/>
- <include method="getTotal"/>
- <include method="getCur"/>
- <include method="cancel"/>
- </create>
------------b端-----------------------
1.将附件form.rar展开到ext/examples/form/下
2.浏览http://host:port/yourapp/ext/examples/form/formext.html
其中photo为Attach类型</include></include></include></create>