Map « Filter « JSP-Servlet Q&A

1. 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-name>sitemesh</filter-name>  ...

2. Filter mapping for everthing to Struts2 besides one servlet?

I have a Struts2 ( web application. My web.xml looks like,



3. A servlet or filter that dynamically maps /xxx/yyy/zzz to class

I want to write a servlet or filter that automatically maps the url /xxx/yyy/zzz to class For example the following URLs will map to the following java classes:

/comment/add -->
/comment/delete --> ...

4. java: question on filter and servlet mapping

I have a web application with the following structure:


5. mapping same servlet filter to more than one filter

I want to map a servlet filter to more than one servlets. I have tried like below ,



6. what are the following terms used in filter mapping?

    <servlet-name>Faces Servlet</servlet-name>
what is request,forward and include used for?

7. Difference between servlet/servlet-mapping and filter/filter-mapping?

As part of exploring/learning Struts2, JSP and Servlets, I see from here and there that servlets and servlets-mapping can be used in web.xml. However, Struts2 mentions ...

8. Servlet Filter: Search when no servlet mapping exists

I would like to run a search whenever a 404 is encountered. For example, a user would like to view restaurants with Italian cuisine, they would go to so instead ...

9. Servlet Mappings with Variables(Tomcat 7.0)

Is it possible to map URLs to servlets (maybe something specific with Tomcat) so that the two following URLs (with {id}'s being variables retrievable from code),


map to two different servlets, or ...

10. filter mapping to servlets

13. filter mapping to specific JSP

15. Servlet filter & mapping

16. servlet and filter mappings

17. web.Xml Mapping For using Filters in Servlets