配置struts-2.5.14.1必需jar包Struts2 2.5的特性变动

1.下载Struts2 : https://struts.apache.org/


Struts 2.5.14.1

Apache Struts 2.5.14.1 is an elegant, extensible framework for creating enterprise-ready Java web applications. It is available in a full distribution, or as separate library, source, example and documentation distributions. Struts 2.5.14.1 is the "best available" version of Struts in the 2.5 series.


2. 解压 :struts-2.5.14.1-all.zip 


我们能看到,当你一直找xwork2的时候,拉到最下面发现不见了!!!

是的,它已经整合到struts2-core当中去了!!!所谓core嘛,当然是一个核心,原来两个合并成一个也是有道理的。

但是随即增加了一下jar,各自功能需要大家自己查阅API,我就不废话了。

3.部署项目的必要jar包:


是就这么多,增加了lang3增强包!!!

4.web.xml文件过滤器也有变动:

if you are using struts2 version 2.5 you need to change from 

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter 

to

 org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter

是的,去掉了中间.ng文件空间名,原因是在整合xwork的时候,同时简化了不必要的包名空间。

<?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" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
  <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

5.在项目根目录空间下创建struts.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>


</struts>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值