You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ron Crayton <rj...@yahoo.com> on 2005/04/11 17:16:18 UTC

crossContext not working

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" timestamp="true"/>
</Context>
 
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!