• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Which servelet to load???????

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! All,

How Server knows which servelet is required to be loaded?
thanks,
SA
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you "register" the servlet in your web.xml, you give it the complete classpath to the servlet (which must, of course, be in the classpath). If you don't need init params, your can just refer to it using the /servlet/ path in the URL.
Were you looking for more explicit details?
hth,
bear
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:
If you "register" the servlet in your web.xml, you give it the complete classpath to the servlet (which must, of course, be in the classpath).


Does every app server have a web.xml file which will have entries for each servlet, or is this something that is specific to a particular app server?
Thanks,
Corey
 
Author
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The notion of a web application was introduced with version 2.2 of the Servlet API. Web applications are a very important concept in that they allow a portable way to structure and bundle applications containing servlets, jsp, and other resources (images, html pages, etc.). The "glue" that binds this application together is an XML descriptor named web.xml (found in the WEB-INF directory off of the application root directory). Within web.xml you can specify things like servlet names, servlet mappings, welcome files, error pages, security constraints, etc. Prior to version 2.2 each servlet container had their own way of defining things like servlet mappings, so this really hindered the ability to port applications from one vendor to the next; web applications have solved this problem (for the most part).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic