开发者

How to specify more than one named Servlet to be wrapped by a filter?

How to specify more than one named Se开发者_StackOverflow中文版rvlet to be wrapped by a filter?


You can map a filter to one or more servlets (and you can map more than one filter to a servlet).

...
<filter>
  <filter-name>filter_name</filter-name>
  <filter-class>filter_class</filter-class>
</filter>
...
<filter-mapping>
  <filter-name>filter_name</filter-name>
  <servlet-name>servlet_name_1</servlet-name>
</filter-mapping>
<filter-mapping>
  <filter-name>filter_name</filter-name>
  <servlet-name>servlet_name_2</servlet-name>
</filter-mapping>
...

See also

  • The Essentials of Filters
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜