tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynir Hübner <>
Subject RE: include jsp from another context (directory)?
Date Mon, 21 Apr 2003 21:57:40 GMT
Hi guys, 

What if you set the crossContext attribute on the context specified in server.xml ?

--8<---- from the docs : 


Set to true if you want calls within this application to ServletContext.getContext() to successfully
return a request dispatcher for other web applications running on this virtual host. Set to
false (the default) in security conscious environments, to make getContext() always return

If I understand the problem correctly this might work ?

Hope it helps

> -----Original Message-----
> From: Hua Hou [] 
> Sent: 21. apríl 2003 21:23
> To: 'Tomcat Users List'
> Subject: include jsp from another context (directory)?
> All, 
> I have the following directory structure:
> ROOT/B/b.jsp 
> ROOT/C/c.jsp. 
> Inside c.jsp I have a line <jsp:include page="/B/b.jsp"/>
> The following URL works fine:
> http://localhost/C/c.jsp
> Now, going into production, I want the URL to be, 

So I created the following mapping in server.xml
      <Host name="" debug="0" appBase="webapps/ROOT" unpackWARs="true" autoDeploy="true">
        <Logger className="org.apache.catalina.logger.FileLogger" directory="logs"  prefix="C_log."
suffix=".txt" timestamp="true"/>
          <Context path="" docBase="C" debug="0"/>

Now the line <jsp:include page="/B/b.jsp"/> gives me problem. 
First, /B/b.jsp does not exist under the context "C". 
Second, Even I create another context"B" as in <Context path="B" docBase="B" debug="0"/>,
/B/b.jsp still can't be found. Third, creating another context is not a solution for me, because
as I know, sessions can't be shared across contexts.

Any idea?



To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message