Struts的介绍
Struts的是阿帕奇软件基金会(ASF)赞助的一个开源项目。它最初是雅加达项目中的一个子项目,并在2004年3月成为ASF的顶级项目。它通过采用JavaServlet / JSP技术,实现了基于JavaEEWeb应用的MVC设计模式的应用框架,是MVC经典设计模式中的一个经典产品。
搭建环境(使用Intellij IDEA + maven + struts2)
1.创建maven+ struts2的项目
2.添加配置文件,自动下载必要jar文件
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.5.14.1</version>
</dependency>
3.web.xml中引入支柱核心功能 - 配置过滤器
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/n