tomcat-users mailing list archives

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

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

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

crossContext 

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
null
 
-->8----


If I understand the problem correctly this might work ?

Hope it helps
-reynir






> -----Original Message-----
> From: Hua Hou [mailto:hua@handango.com] 
> 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 
http://C.mycompany.com/c.jsp, 

So I created the following mapping in server.xml
      <Host name="C.mycompany.com" 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"/>
      </Host>

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?

Thanks.

Hua

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message