struts2实验02 单文件上传, 多文件上传, 文件下载
2021-04-21 22:27
标签:core jetty seconds Delve str org pre coding app 1、IDEA创建一个maven项目, 项目结构为: 2、在pom.xml中引入项目依赖, strtus2和servlet, 服务器容器为jetty 3、web.xml : 设置web项目的结构, 引入struts拦截器, 所有的URL的请求都必须通过struts 4、 struts2实验02 单文件上传, 多文件上传, 文件下载 标签:core jetty seconds Delve str org pre coding app 原文地址:https://www.cnblogs.com/huangZ-H/p/12247457.html.
├── FileUpload.iml
├── pom.xml
├── src
│ └── main
│ ├── java
│ │ └── shiyanlou
│ │ └── struts
│ │ ├── DownloadAction.java
│ │ ├── MultiUploadAction.java
│ │ └── UploadAction.java
│ ├── resources
│ │ └── struts.xml
│ └── webapp
│ ├── WEB-INF
│ │ └── web.xml
│ ├── error.jsp
│ ├── index.jsp
│ ├── success.jsp
│ ├── uploadFiles
│ │ └── test2.txt
│ └── uploadMultiFiles
│ ├── test.txt
│ └── test2.txt
xml version="1.0" encoding="UTF-8"?>
project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
modelVersion>4.0.0modelVersion>
groupId>org.examplegroupId>
artifactId>FileUploadartifactId>
version>1.0-SNAPSHOTversion>
packaging>warpackaging>
dependencies>
dependency>
groupId>org.apache.strutsgroupId>
artifactId>struts2-coreartifactId>
version>2.5.18version>
dependency>
dependency>
groupId>javax.servletgroupId>
artifactId>javax.servlet-apiartifactId>
version>4.0.1version>
scope>providedscope>
dependency>
dependencies>
build>
finalName>FileUploadfinalName>
plugins>
plugin>
groupId>org.eclipse.jettygroupId>
artifactId>jetty-maven-pluginartifactId>
version>9.4.12.v20180830version>
configuration>
scanIntervalSeconds>10scanIntervalSeconds>
webApp>
contextPath>/contextPath>
webApp>
configuration>
plugin>
plugins>
build>
project>
xml version="1.0" encoding="UTF-8"?>
web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
display-name>FileUploaddisplay-name>
filter>
filter-name>struts2filter-name>
filter-class>
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
filter-class>
filter>
filter-mapping>
filter-name>struts2filter-name>
url-pattern>/*url-pattern>
filter-mapping>
welcome-file-list>
welcome-file>index.htmlwelcome-file>
welcome-file>index.htmwelcome-file>
welcome-file>index.jspwelcome-file>
welcome-file>default.htmlwelcome-file>
welcome-file>default.htmwelcome-file>
welcome-file>default.jspwelcome-file>
welcome-file-list>
web-app>
上一篇:JQUERY的基本使用方法
文章标题:struts2实验02 单文件上传, 多文件上传, 文件下载
文章链接:http://soscw.com/index.php/essay/77792.html