Manager for filter matching

I have an application written for Servlet Spec 2.4 with an old web server 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 rewrite this mapping for servlet 2.3 compatibility?

+7
java jsp
source share
2 answers

You can simply delete the <dispatcher> entries. The Servlet 2.3 filter sends everything by default, and that's fine. Sitemesh even mentions on its own site that it is compatible with Servlet 2.3. Here is an excerpt from their site :

SiteMesh is a servlet filter, so a container that meets the Servlet 2.3 specification is required.

+9
source share

Just remove the <dispatcher tags.

Servlet 2.3 does not support dispatchers. If you do not, it does not matter. If you enabled the servlet / JSP, you need to rename them so that they are not filtered to get the exact behavior as 2.4.

+1
source share

All Articles