websphere tomcat下,filter的不同表现

<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" 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"> <display-name>test_web</display-name> <filter> <filter-name>Filter1</filter-name> <filter-class>filter.Filter1</filter-class> </filter> <filter-mapping> <filter-name>Filter1</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>

 

在websphere下,

直接访问/test_web,过滤器filter.Filter1不起作用,

而在tomcat下可以。

 

在websphere下,需要单独配置一个url-pattern

<url-pattern>/</url-pattern>

你可能感兴趣的:(tomcat,Web,filter,websphere,webapp,encoding)