• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Setting up CrossContext configuration in Tomcat

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.



 
Your buns are mine! But you can have this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic