jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes How is the web app chosen 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 is the web app chosen" Watch "How is the web app chosen" New topic
Author

How is the web app chosen

Pankaj Kumarkk
Ranch Hand

Joined: Apr 17, 2011
Posts: 108
I have a fundamental question about web applications.

The question is:
How does a URL like www.abc.com:8080/app1/app1servlet gets mapped to web application "app1".
Following is what happens

1. Put "www.abc.com:8080/app1/app1servlet" in browser address bar and hit go
2. Browser sends a HTTP request as below
GET /app1/app1servlet HTTP/1.1
Question: how does the servlet container determine that the request has to routed to application "app1". Does the container always assumes that first part of URL is application name(here app1)

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60755
    
  65

Yes, the first part of the URL identifies the context path of the application to which the request will be targeted.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: How is the web app chosen
 
Similar Threads
SendRedirect() - 2 Forms of Relative URL's
sessions
tomcat workflow
How to make selective jsp files secured
For Struts developers