• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regn of servlets in Tomcat.

 
Thillai Sakthi
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Anand Jayaraman
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13073
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic