File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Filter VS controller servlet" Watch "Filter VS controller servlet" New topic

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".

A Kumar
Ranch Hand

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

Juanjo Bazan
Ranch Hand

Joined: Feb 04, 2002
Posts: 231
Before the request reaches the servlet associated to that url, it goes through all the filters chain.
I agree. Here's the link:
subject: Filter VS controller servlet