This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes How does container determines that the call is to a servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How does container determines that the call is to a servlet?" Watch "How does container determines that the call is to a servlet?" New topic
Author

How does container determines that the call is to a servlet?

Sony Agrawal
Ranch Hand

Joined: Oct 04, 2009
Posts: 143
Is it by looking at the web.xml file that the container determines that the call is to the servlet ??

rakesh kadulkar
Ranch Hand

Joined: Jul 24, 2008
Posts: 115
When you make a request then the request will be intercepted by the container and the container is programmed to read

theweb.xml file in the WEB-INF folder. And in the deployment descriptor you specify the mapping of the url to a servlet.


Rakesh Kadulkar
Salil Vverma
Ranch Hand

Joined: Sep 06, 2009
Posts: 253

Hey Sony,

You are right .As you know that for each servlet we define servlet-mapping in web.xml, container matches the url pattern fired from the browser with mentioned in web.xml and then forwards the request to that specific servlet.

The example of defining the servlet mapping to a url-pattern is as mentioned below.



Regards
Salil Verma
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How does container determines that the call is to a servlet?
 
Similar Threads
NullPointerException on getServletContext
destroy() method
Static Initialization Block
Thread Safety question
calling a servlets