• 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

cross context in tomcat

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Please Check the Jsp page folder whether it is in folder direct to it or use web.xml file to configure the url pattern for the jsp so that you could forward the request.
Ur's
Laxmi
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tested to insure that the other application is running properly?
Can you hit the JSP or HTML page on the other app directly, with a browser?
reply
    Bookmark Topic Watch Topic
  • New Topic