tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Crayton <>
Subject crossContext not working
Date Mon, 11 Apr 2005 15:16:18 GMT
I'm trying to forward a request from an app running in Tomcat 5.5.7 to an html document outside
of the app's context.  The html document is in the htdocs folder of Apache HTTP Server 2.0.
My context.xml document for the app looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/LoginApp" docBase="LoginApp" debug="0" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="LoginApp." suffix=".log"
The code looks like this:
        ServletContext context = getServletConfig().getServletContext();
        ServletContext foreignContext = context.getContext("/");
        RequestDispatcher requestDispatcher = foreignContext.getRequestDispatcher("/try.html");
        requestDispatcher.forward(request, response);

The problem:  foreignContext is always null.
I thought that the crossContext attribute was supposed to fix this but it isn't working.
Please help.
Thank you.

Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site! 
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message