还是配置过滤器的问题
在web.xml中,我的多个条件,如:*.do,*.jsp,*.htm等需要用同一个过滤类,
怎样写最简单,而不用一个一个的配?(不能用/*)
就象:
<filter>
<filter-name> Login Filter </filter-name>
<filter-class> org.sms.common.filter.LoginFilter </filter-class>
</filter>
<filter-mapping>
<filter-name> Login Filter </filter-name>
<url-pattern> *.do,*.jsp,*.htm </url-pattern>
</filter-mapping>
------解决方案--------------------这样好象不行
只能一个一个的配
------解决方案-------------------- <filter>
<filter-name> Login Filter </filter-name>
<filter-class> org.sms.common.filter.LoginFilter </filter-class>
</filter>
<filter-mapping>
<filter-name> Login Filter </filter-name>
<url-pattern> *.do </url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name> Login Filter </filter-name>
<url-pattern> *.jsp </url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name> Login Filter </filter-name>
<url-pattern> *.htm </url-pattern>
</filter-mapping>
反正你需要多少个就写多少的filter-mapping段