JSP, Filter and Forward

Filters generally applied to corresponding requests. But when the request is forwarded from one servlet to another source, that will not be processed with Filter. (I checked with Tomcat 4.1). We need to add some more parameters with Filter mapping as noted below.

<filter-mapping> <filter-name>VJFilterTest</filter-name> <!–<servlet-name>VJServlet</servlet-name>–> <url-pattern>/servlet/MyTest</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> ————————————————— *Free* software is a matter of liberty not price. You should think of “free” as in “free speech”.

Comments are closed.