This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Regn of servlets in Tomcat." Watch "Regn of servlets in Tomcat." New topic
Author

Regn of servlets in Tomcat.

Thillai Sakthi
Ranch Hand

Joined: Jun 17, 2000
Posts: 102
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?
TIA


Regards,
Shakthi
Anand Jayaraman
Ranch Hand

Joined: Jan 28, 2004
Posts: 104
Hi,
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
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
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.
Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Regn of servlets in Tomcat.
 
Similar Threads
return an object from servlet
where is servlet System.out output?
Delete parameters in a Request object
static variable in a servlet
ServletContext doubt ?