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.
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 Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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
It's not a secret anymore!