我在weblogic中部署了2个网络应用。因为他们每个人都有一个单独的hibernate会话工厂。
我在webapp2中使用specialServlet来使第二级缓存无效。 filter1
用于设置hibernate会话,因此我可以调用以使第二级缓存无效。
我在web app2中包含/ servlet / specialServlet。
我希望定期请求为filter1
调用/servlet/*
。
但对servlet/specialServlet
我希望filter1
不仅可以通过常规请求调用,还可以调用include
请求。
指定过滤器映射的最佳方法是什么?
同样,过滤器映射元素的顺序对filter1
?
<web-app version="2.5" 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_2_5.xsd">
xxx
<filter>
<filter-name>filter1</filter-name>
<filter-class>xxx</filter-class>
</filter>
<filter-mapping>
<filter-name>filter1</filter-name>
<url-pattern>/servlet/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>filter1</filter-name>
<url-pattern>/servlet/specialServlet</url-pattern>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
xxx
</web-app>