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 Tomcat and the fly likes Setting up CrossContext configuration in Tomcat 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 » Products » Tomcat
Bookmark "Setting up CrossContext configuration in Tomcat" Watch "Setting up CrossContext configuration in Tomcat" New topic
Author

Setting up CrossContext configuration in Tomcat

Praveen Yendluri
Ranch Hand

Joined: Apr 13, 2011
Posts: 34
Hi

I am trying to access a web application that was in different context in the same server (Tomcat 6.0.26). I had writtem below code in server.xml file (Path: \Apache Software Foundation\Apache Tomcat 6.0.26\conf\server.xml).


<Host name="localhost" appBase="webapps" debug="0"
unpackWARs="false" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">


<Context path="/est" debug="0" crossContext="true"/>
<Context path="/PeimeSamp" debug="0" crossContext="true"/>

</Host>

My code in JSP is trying to print Context Object, but it is getting null.

<% ServletContext ctx= application.getContext("/PeimeSamp");%>
<%=thatctx %>


Could any one helpe how to make cross context calls in Tomcat? Is my server.xml configuration correct?

Thank you,
Praveen
Tapan Maru
Ranch Hand

Joined: May 08, 2006
Posts: 65
in the server.xml there is one proerty called crossContext. if you will set it to true, it allows the ServletContext.getContext() method to successfully return the ServletContext for other Web applications running in the same host.




Tapan Maru
tapanmaru@gmail.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting up CrossContext configuration in Tomcat