intellij 13 建立maven项目实现struts2 框架
建立intellij webapp maven项目
添加pom.xml文件相关部分
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.1.2</version>
</dependency>
修改web.xml文件
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
webapp 文件夹下建立JSP文件 helloWorld.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>test</title>
</head>
<body>
test struts
</body>
</html>
resources文件夹下建立文件struts.xml,修改内容
<struts>
<package name="default" namespace="/" extends="struts-default">
<action name="hello">
<result name="success">
/helloWorld.jsp
</result>
</action>
</package>
</struts>
配置tomcat,启动服务器
访问http://localhost:8080/hello,出现页面跳转
说明struts2 webapp maven项目配置完成