码迷,mamicode.com
首页 > 其他好文 > 详细

Intellij IDEA中使用Struts2

时间:2016-09-09 00:48:24      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

据说struts2中有很多的漏洞, 不过作为学习我也就用了吧, 因为书上面是按着这个讲的呀.

难怪官网上也没有struts2.2.1的版本的下载.

1. 下载struts2.2.1 ga版本

2. 新建一个web工程

技术分享

3. 将下列的包导入到web/WEB-INF/lib目录下, 并添加包

技术分享

4. 在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/ns/javaee/web-app_3_1.xsd"
version="3.1">

<!-- 定义Struts2的核心Filter -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<!-- 让Struts2的核心Filter拦截所有请求 -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


</web-app>
 
 

Intellij IDEA中使用Struts2

标签:

原文地址:http://www.cnblogs.com/tuhooo/p/5854926.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!