• Post Reply Bookmark Topic Watch Topic
  • New Topic

which server to load?  RSS feed

 
Sanjeev Shahi
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! All,
How server knows which servelet it has to load?
Tahnks
SS
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a couple of ways. It could be based off of the url or is could be set in the web.xml file.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yup... usually in the world of Servlet 2.3 the Server knows through a combination of the URL and the web.xml -->
snippet from web.xml:

so for the URL-- http://host/webapp/testResponse
The server will go to the Web Applicatoin named "webapp" and look inside the web.xml for the url-pattern "/testResponse" it then matches that up to the <servlet> listed with the same <servlet-name> which in this case is com.jess.blah.testResponse
 
Sanjeev Shahi
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply. I think I got my answer.
SS
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!