• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Regn of servlets in Tomcat.

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic