This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
It depends on how you configure filter in web.xml file. If you configure filter for ActionServlet then each and every request would certainly go through that configured filter. You could debug the app to find out whether it is going through Filter or not. Following is the code from web.xml to configure the Filter for ActionServlet.
As per your web.xml the request will first go to Filter then ActionServlet, give a look to j2ee design pattern blueprint java.sun.com site. <br> There you can see the sequence that follows, the intercepting filters fowards the request to front controller [ April 05, 2007: Message edited by: Rohit Passi ]
Joined: Apr 04, 2007
For your web.xml cofiguration, each request will go through the HibernateFilter.
Rohit's point is correct.
------------ SCJP 1.4, SCWCD 1.4, SCBCD 1.3, (SCEA Part I preparing......)
Joined: Sep 28, 2006
is filters are execueted in the order they have configured in the web.xml
is it possible if i want to change the sequence of filter without
altering the web.xml.by doing programatically [ May 30, 2007: Message edited by: Amirtharaj Chinnaraj ]
J2EE Level 1.2 includes a Servlet Specification level of 2.2 and a JSP Specification level of 1.1. Features such as Servlet Filters and Life Cycle Event Listeners cannot be be used if this level is chosen. Applications developed for this J2EE level 1.2 typically target a WAS version 4.x server. In such cases you can add filters but they would only get execute after your ActionServlet
If you are using J2EE Level 1.3 includes a Servlet Specification level of 2.3 and a JSP Specification level of 1.2 then first filter and then ActionServlet get executed..
Joined: Sep 28, 2006
george thanks for your reply
what my questions is ?
is it possible to change the sequence of the filter execution
by programming a filter or using some other servlet . i have analysed
that filters are execuited according to the hirerchey
I dont think so you can be able to change the order of execution of filters because all you have is doFilter() method for passing it onto the next Filter in the chain, which inturn being implemented by the container with the content of webxml.