Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cross Context in Tomcat

 
sam prochazka
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My server.xml is as follows:
<Host name="localhost" debug="0" appBase="c:/RealPageMaker/webapps" unpackWARs="false">
<Context path="" docBase="webapp1" debug="0" crossContext="true"/>
<Context path="/webapp2" docBase="webapp2" debug="0" crossContext="true"/>
</Host>
The .jsp code in webapp1 is as follows:
<% ServletContext thatctx= application.getContext("/webapp2");
RequestDispatcher rdpt=thatctx.getRequestDispatcher("/test.jsp");
rdpt.forward(request, response); %>
This does not work, but the following does (with an HTML page):
<% ServletContext thatctx= application.getContext("/webapp2");
RequestDispatcher rdpt=thatctx.getRequestDispatcher("/test.htm");
rdpt.forward(request, response); %>
What am I doing wrong? Is this a tomat bug? Has anyone got this working with tomcat 4.1.12?
Sam P.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is NOT a web services question. This is getting moved to the Tomcat forum.
Kyle
 
Subrmaniam Narayanan Iyer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In the server.xml of tomcat, u got a context tag. Context tag takes an attribute cross-context, default it is set to false. Probably if u set it to true, it will work.

Hope it works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic