Struts的其他应用.pptVIP

  • 6
  • 0
  • 约8.39千字
  • 约 24页
  • 2019-07-03 发布于福建
  • 举报
Struts的其他应用

6.1 Struts 2文件上传 6.2 Struts 2文件下载 6.3 Struts 2国际化应用 6.1.1 单文件上传 【实例6.1】用Struts 2的Common-FileUpload框架上传单个文件。 1.创建Struts 2项目 建立项目,取项目名为“StrutsUpload”。加载Struts 2包及修改web.xml文件,配置Struts 2,操作同【实例2.1】的第1步、第2步,不再赘述。 2.修改index.jsp 在创建项目的时候,勾选自动生成index.jsp文件,读者可以应用该文件,将其中内容替换为自己编写的代码,如下: %@ page language=java pageEncoding=utf-8% %@ taglib uri=/struts-tags prefix=s% html head title文件上传/title /head body s:form action=upload method=post enctype=multipart/form-data s:file name=upload label=上传的文件/s:file s:submit value=上传/s:submit /s:form /body /html 3.编写Action类 前面已经介绍过,功能的处理一般都在Action类中实现;处理完成后,进

文档评论(0)

1亿VIP精品文档

相关文档