File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Regn of servlets in Tomcat. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Regn of servlets in Tomcat." Watch "Regn of servlets in Tomcat." New topic

Regn of servlets in Tomcat.

Thillai Sakthi
Ranch Hand

Joined: Jun 17, 2000
Posts: 103
Hi All:
Do I have to register (in web.xml) ALL the servlets I use in a application?
Can I use even without registering the same?

Anand Jayaraman
Ranch Hand

Joined: Jan 28, 2004
Posts: 104
If you don't want to mention the servlets in the web.xml file, you will have to call the servlet from the browser by its fully qualified name.
In simpler terms, you actually map the servlet class name (say for eg: JavaRanchServlet) with a name (say, JavaRanch) in the deployment descriptor so that your servlet can be called by its mapped-name(i.e JavaRanch). However, if you don't use the deployment descriptor you will have to call the servlet as JavaRanchServlet.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
You can execute non-registered servlets by name ONLY if the invoker servlet is turned on. If you have any serious use of servlets in mind, go ahead and learn how to properly set up web.xml. You will be glad you did.
See the JavaRanch collected wisdom on invoker.
I agree. Here's the link:
subject: Regn of servlets in Tomcat.
jQuery in Action, 3rd edition