Struct2中自定义的Filter无效
Posted Season
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Struct2中自定义的Filter无效相关的知识,希望对你有一定的参考价值。
解决办法,把自定义的Filter配置放在struct2前
<?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <filter> <filter-name>LogFilter</filter-name> <filter-class>com.*.LogFilter</filter-class> </filter> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>LogFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>LogFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> ... </web-app>
以上是关于Struct2中自定义的Filter无效的主要内容,如果未能解决你的问题,请参考以下文章
如何:在wordpress中自定义帖子类型的自定义类别存档页面