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 How does Application Identify Context Path automatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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: 1966
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How does Application Identify Context Path automatically
 
Similar Threads
Context hell
adding a Datasource to tomcat jndi
How Tomcat Works book - development question
html:link tag usage
Identify context path + servlet path+ path info for given URL