Dispatcher for Filter Mapping
I have an app written for Servlet Spec 2.4 with an old webserver designed for Servlet Spec 2.3. The web.xml file has the following syntax:
<filter-mapping>
<filter-name>sitemesh<开发者_开发技巧/filter-name>
<url-pattern>*.action</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
How can I re-write this mapping to be servlet 2.3 compliant?
You can just remove the <dispatcher>
entries. The Servlet 2.3 filter by default dispatches on everything and that's just okay. Sitemesh even mentions at its own site that it's compatible with Servlet 2.3. Here's an extract from their site:
SiteMesh is a Servlet Filter and therefore requires a container that conforms to the Servlet 2.3 specification.
Just remove the <dispatcher> tags.
Servlet 2.3 doesn't support dispatchers. If you don't do include, it doesn't make any difference. If you do have included servlet/JSP, you need to rename them so they are not filtered to get the exact behavior as 2.4.
精彩评论