struts2 --xml配置
struts2.5 官方文档介绍
这个是struts2.5给出的web.xml配置方式,核心包已经被挪到了ng的上一层
<web-app id="MyStrutsApp" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <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> <!-- ... --></web-app>以下是以下介于struts2.1.3和staruts2.5之间(struts2.1.3<= web.xml < struts2.5)
...
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>...
以下为低于struts2.1.3的配置
...
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>...
不清楚的可以解压 struts-core.jar 进行查看,是否有对应的字节码文件

浙公网安备 33010602011771号