商讯信箱
用户名: @
密  码:   注册|忘记密码
登录
个人用户经销商
您的位置:首页 > 技术频道 > 正文

IT168技术文档】 
      建立上传用的JSP文件 upload.jsp
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <html:html> <head> <title>用Struts上传文件</title> </head> <body> <html:form action="/uploadsAction" enctype="multipart/form-data"> <html:file property="theFile"/> <html:file property="theFile2"/> <html:submit/> </html:form> </body> </html:html>
     配置struts-config.xml文件
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts-config PUBLIC "-
//Apache Software Foundation//DTD Struts Configuration 1.1//EN
"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"> <struts-config> <data-sources /> <form-beans > <form-bean name="uploadsForm" type="com.cnehu.struts.form.UpLoadForm" /> </form-beans> <global-exceptions /> <global-forwards > </global-forwards> <action-mappings > <action name="uploadsForm" type="com.cnehu.struts.action.UpLoadAction"
path
="/uploadsAction"> <forward name="display" path="/display.jsp" /> </action> </action-mappings> </struts-config>
1 2
©版权所有。未经许可,不得转载。
[责任编辑:郭宗一]
[an error occurred while processing this directive]