This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes Filter VS controller servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Filter VS controller servlet" Watch "Filter VS controller servlet" New topic
Author

Filter VS controller servlet

mohan kumar r
Ranch Hand

Joined: Jan 19, 2006
Posts: 38
In a simple web application,i wrote one controller servet and one filter and congigure those in web.xml. My doubt is that
"both filter and controller servlet acts as interceptor of requests.if i configure the controller servlet and filter for the same request Url,whic one get executed first".


mohan
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
I believe it is the filter which will have greater precedence than the Controller servlet.

Regards
Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Right.
Before the request reaches the servlet associated to that url, it goes through all the filters chain.
HTH
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Filter VS controller servlet