filter 无效不起作用

参考自http://blog.sina.com.cn/s/blog_6ebc885a01016olq.html

<filter>
        <filter-name>testfilter-name>
        <filter-class>filter.FilterTestfilter-class>
    filter>
    <filter-mapping>
        <filter-name>testfilter-name>
        /*
    filter-mapping>


    <filter>
        <filter-name>struts2filter-name>
        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterfilter-class>
    filter>
    <filter-mapping>
        <filter-name>struts2filter-name>
        /*
    filter-mapping>

你的filter必须的放在Struts2的上面才行!!

你可能感兴趣的:(struts2)