This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes How does Application Identify Context Path automatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How does Application Identify Context Path automatically" Watch "How does Application Identify Context Path automatically" New topic
Author

How does Application Identify Context Path automatically

anand ashokan
Greenhorn

Joined: Oct 18, 2012
Posts: 1
Say i have an EAR with application.xml which has context root defined as Myapp for the corresponding war.

When i access it through my local machine i use http://localhost:8080/Myapp

But In Production i am able to access the application www.xyz.com it automatically identifies the context path .

Is this a configuration done in Webserver to automatically redirect ?.
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2379
    
    7

Welcome to the Ranch.

The context path in your "localhost:8080/Myapp" is Myapp. In production, mostly the front end uses Apache web server and Tomcat or Java app server as JSP/Servlet container. There is a module called "jk_mod" that does the redirection based on some configuration in the Apache config file httpd.conf. So it's not automatic.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
 
subject: How does Application Identify Context Path automatically