Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Need Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Need Help" Watch "Need Help" New topic

Need Help

Ganch Meky

Joined: Oct 25, 2000
Posts: 5
Hi all,
I have a "controller" servlet that I want all requests to my web resources to go through. Regardless of what servlet a user is trying to access I want them to be forwarded to my "controller" servlet. So, in my deployment descriptor I specified the URL mapping for my "controller" servlet as
In the controller servlet, I then check the path info and forward the request to the appropraite servlet that should be responsible for handling the request. However, when I do the forwarding the request gets forwarded back to the controller servlet, since the deployment descriptor requires it to handle all requests, thus creating an infinite loop. I don't want my other servlets to be accessed directly by typing up the URL in a browser - I want all requests to go through the controller.
Is there a way to do that ? I appreciate any help I can get on this.
Ganch Meky

Joined: Oct 25, 2000
Posts: 5
Sorry, I meant to say
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
PLease visit this link. It may be of some help.
maha anna
I agree. Here's the link:
subject: Need Help
Similar Threads
MVC Architecture for Web
question on servlet mapping !!!
Hosting problem , the Host provider tomcat does not understand .do
url formating in web apps
Servlet to servlet