File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Which servelet to load??????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Which servelet to load???????" Watch "Which servelet to load???????" New topic
Author

Which servelet to load???????

shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
Hi! All,

How Server knows which servelet is required to be loaded?
thanks,
SA
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
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


SCJP Tipline, etc.
Karl Moss
Author
Greenhorn

Joined: Feb 08, 2002
Posts: 18
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).


Karl Moss,<br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/007222262X/ref=ase_electricporkchop" target="_blank" rel="nofollow">Java Servlets Developer's Guide</a> <br /><a href="http://www.servletguru.com" target="_blank" rel="nofollow">ServletGuru.com</a> the Companion site.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Which servelet to load???????
 
Similar Threads
how to send & by appending the URL
servlets and configuration
Difference between server and container
which server to load?
hi help me