You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Asim Alp <de...@educationalnetworks.net> on 2004/03/02 17:18:20 UTC

cross context include

My application was running without any problems on Tomcat 5.0.18.   
After upgrading to Tomcat 5.0.19, I started having problems with my  
cross context includes.  I haven't changed a single line of code.   
Server.xml is the same as well.  Here is the host section on my  
server.xml:

<Host name="www.domain1.com" debug="0" appBase="webapps/domains"  
unpackWARs="true" autoDeploy="true" xmlValidation="false"  
xmlNamespaceAware="false">
	<Logger	className="org.apache.catalina.logger.FileLogger"  
directory="logs" prefix="BXSCI_" suffix=".log" timestamp="true"/>
			
	<Context path="" docBase="domain1" debug="0" crossContext="true"  
caseSensitive="false" />
	<Context path="/jsp-apps" docBase="jsp-apps" debug="0"  
crossContext="true" caseSensitive="false" />
</Host>

In the "/" context, my index.jsp is as follows:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<c:import url="/shared/header.jsp" context="/jsp-apps" />
.....

In the "/jsp-apps" context /shared/header.jsp is just a simple JSP page.

Here is the error message I get:

javax.servlet.ServletException: /shared/header.jsp
          
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCont 
extImpl.java:867)
          
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex 
tImpl.java:800)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:123)
          
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
          
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja 
va:311)
          
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 
301)
          
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


root cause
javax.servlet.jsp.JspTagException: /shared/header.jsp
          
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString( 
Unknown Source)
          
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(Unkno 
wn Source)
          
org.apache.jsp.index_jsp._jspx_meth_c_import_0(index_jsp.java:142)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:54)
          
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
          
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja 
va:311)
          
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 
301)
          
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


Any ideas?

Asim

Re: cross context include

Posted by Remy Maucherat <re...@jboss.org>.
Asim Alp wrote:
> I found the reason of the previous error message.  However, I'm still 
> having a problem.  This time my <c:import ... tag doesn't load anything 
> at all.
> 
> Here is my setup:
> 
> /test.jsp (context "")
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> This is test.jsp<br><br>
> <c:import url="/hello.jsp" context="/jsp-apps" />
> 
> /hello.jsp (context /jsp-apps)
> Hello World!<br>
> 
> When I view /test.jsp, I only get:
> This is test.jsp
> 
> In my browser.
> 
> I tried one more thing.  I replaced test.jsp with the following:
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> This is test.jsp<br><br>
> <c:import url="http://www.yahoo.com" />
> 
> It worked!  I got a page that says "This is test.jsp" at the top 
> followed by the frontpage of yahoo.com.
> 
> Any suggestions?

So I moved my test.jsp to the root folder, added a ROOT.xml context file 
with crossContext="true", and it still works.

Your response is committed. Look in the logs for the stack trace of the 
error.

-- 
xxxxxxxxxxxxxxxxxxxxxxxxx
Rémy Maucherat
Developer & Consultant
JBoss Group (Europe) SàRL
xxxxxxxxxxxxxxxxxxxxxxxxx

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


Re: cross context include

Posted by Aadi Deshpande <ma...@clubmom-inc.com>.
I think I came across a couple of things that should help resolve the 
issue.

1) in ApplicationContext, the getContext(String path) method erroneously 
checks for context != null in the while loop when it should be checking 
for child !=null (since it seems if the context is ever null, it would 
throw an NPE well before that point, so I'm assuming that was an 
oversight ).

2) This, I believe, to be the underlying cause of my issue.  It occurs 
in wrapRequest in ApplicationDispatcher.   What is going on is that ( 
using my example page / context names from  below ), when I start at 
page Z in context a and call page X in context b, the contexts are both 
different, and crossContext = true ( wrapRequest defines crossContext as 
context.getPath != current.getContextPath() ).  Since the 
getSession(boolean create) is wrapped entirely in an  'if crossContext = 
true' block, the code get executed fine..

It's when the included page X in context  includes a page Y in context b 
again that the problem arises.. Now, since context.getPath == 
current.getContextPath(), the whole getSession() block is never 
executed, adn the session creation is delegated to the super.getSession 
and the incorrect session is retrieved.

I don't know enough about Tomcat ( though I am learning ) to understand 
the relationships between contexts, request, and their respective 
facades and wrappers, so I'm hoping someone on the list who's involved 
in the development can shed some light on the proper resolution.

much thanks in advance,
-a

Aadi Deshpande wrote:

> More research...once the context gets set in a c:import, it seems like 
> that's the way it's stuck for the life of the HttpRequest.  ..
>
> i.e. in my example below..
>    if i start at page Z, the context always remains as 'a'
>    if I start at page X, the context always remains as 'b'
>
> so it looks like tomcat can't handle more than one context switch, 
> maybe because the request that is created for the initial page is the 
> one that's passed down ( instead of a separate internal request being 
> created for the import )
>
> Any more thoughts?
>
>
> Aadi Deshpande wrote:
>
>> I've been struggling with the same problem.  I read the bug report, 
>> but it only adresses part of the problem, the part that doesn't 
>> retrieve the
>>
>> session properly.  I actually patched the code independently and have 
>> discovered another problem, that somehow sessions are either getting 
>> lost or mixed up when you do cross context imports  in at least one 
>> advanced scenario :
>>
>> 1) page Z in context 'a' import a page X from context 'b'
>> 2) page X in context 'b' imports a page Y in context 'a'
>>
>> in this case, the session that was created when you import page X in 
>> context b is the session that's available in page Y in context a.
>>
>> here's my test case  ---
>>
>> test_page1.jsp ( context '/profile' ) :
>>
>>    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>>    Test of cross context imports :
>>    <% request.getSession().setAttribute("test_attrib", "12345"); %>
>>    <% out.println("test_attrib in ( test_page1.jsp ) is " +
>>    session.getAttribute("test_attrib") ); %><br/>
>>    <% out.println("session id (  in test_page1.jsp) is : " +
>>    request.getSession().getId() ); %> <br/>
>>    <c:import url="/test_other.jsp" context="/" />
>>
>> test_other.jsp ( context '/' ) :
>>
>>    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>>    <% request.getSession().setAttribute("test_other_attrib", "54321" );
>> %>
>>    <% out.println("test attrib ( in test_other.jsp ) is : " +
>>    request.getSession().getAttribute("test_attrib") ); %><br/>
>>    <% out.println("test other attrib ( in test_other.jsp) is : " +
>>    request.getSession().getAttribute("test_other_attrib") ); %><br/>
>>    <% out.println("session id (  in test_other.jsp) is : " +
>>    request.getSession().getId() ); %> <br/>
>>    <c:import url="/test_page2.jsp" context="/profile"/>
>>
>> test_page2.jsp ( context '/profile' ) :
>>
>>    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>>    <% out.println("test_attrib ( in test_page2.jsp ) is " +
>>    session.getAttribute("test_attrib") ); %> <br/>
>>    <% out.println("test other attrib ( in test_page2.jsp) is : " +
>>    request.getSession().getAttribute("test_other_attrib") ); %> <br/>
>>    <% out.println("session id (  in test_page2.jsp) is : " +
>>    request.getSession().getId() ); %> <br/>
>>
>>
>>
>> The output i get when I hit test_page1.jsp is :
>>
>>
>> Test of cross context imports : test_attrib in ( test_page1.jsp ) is
>> 12345
>> session id ( in test_page1.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
>> test attrib ( in test_other.jsp ) is : null
>> test other attrib ( in test_other.jsp) is : 54321
>> session id ( in test_other.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
>> test_attrib ( in test_page2.jsp ) is null
>> test other attrib ( in test_page2.jsp) is : 54321
>> session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
>>
>>
>> The output I get when i hit test_other.jsp is :
>>
>>
>> test attrib ( in test_other.jsp ) is : null
>> test other attrib ( in test_other.jsp) is : 54321
>> session id ( in test_other.jsp) is : 55B2068D3011D727DF15068ADAD713E2
>> test_attrib ( in test_page2.jsp ) is null
>> test other attrib ( in test_page2.jsp) is : null
>> session id ( in test_page2.jsp) is : 55B2068D3011D727DF15068ADAD713E2
>>
>>
>> the output that i get when i hit test_page2.jsp :
>>
>> test_attrib ( in test_page2.jsp ) is 12345
>> test other attrib ( in test_page2.jsp) is : null
>> session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
>>
>>
>> Any hints on how to resolve it?
>>
>>
>> Asim Alp wrote:
>>
>>> If indeed we need to put it on all pages, then yes, it's no 
>>> problem.  We do have a couple perl geniuses on staff :)  I'm sure 
>>> we'll find a way to get around it.
>>>
>>> My main concern right now is to to understand the reason of the 
>>> problem first.  I read the bug report, but still can't understand 
>>> why an extra session prevents our c:imports from working?
>>>
>>> Asim
>>>
>>> On Mar 2, 2004, at 1:46 PM, Mike Curwen wrote:
>>>
>>>> If you have a perl genius on staff, he can do ALL pages with a single
>>>> command.  Scary stuff, but cool when it works. :)
>>>>
>>>>> -----Original Message-----
>>>>> From: Asim Alp [mailto:dev.list@educationalnetworks.net]
>>>>> Sent: Tuesday, March 02, 2004 12:33 PM
>>>>> To: Tomcat Users List
>>>>> Subject: Re: cross context include
>>>>>
>>>>>
>>>>> I guess we'll have to find a way of going over the 10,000+ pages.
>>>>> Maybe we can write a small program to automate it.  I don't
>>>>> like dirty
>>>>> solutions :)  If this is indeed a bug in our software, it
>>>>> should better
>>>>> be fixed.
>>>>>
>>>>> One last question though.  As much as I know, setting page session
>>>>
>>>>
>> to
>>
>>>>> false only means that there is no need to create an
>>>>> additional session.
>>>>>   What's this have to do with c:imports?  Why does an
>>>>> additional session
>>>>> prevent our c:imports?
>>>>>
>>>>> Asim
>>>>>
>>>>> On Mar 2, 2004, at 1:15 PM, Remy Maucherat wrote:
>>>>>
>>>>>> Asim Alp wrote:
>>>>>>
>>>>>>> Thank you for your prompt replies.  I just read the bug, and
>>>>>>> understood what the problem was.
>>>>>>> Now, though, I have another question.  Is there a way of
>>>>>>
>>>>>>
>>>>>>
>>>>> setting page
>>>>>
>>>>>>> session to false at a higher level.  For example somewhere
>>>>>>
>>>>>>
>>>>>>
>>>>> from the
>>>>>
>>>>>>> server.xml file?  My problem is that we have over 100
>>>>>>
>>>>>>
>>>>>>
>>>>> websites with
>>>>>
>>>>>>> tens of thousands of jsp pages.  Every single one of these
>>>>>>
>>>>>>
>>>>>>
>>>>> JSP pages
>>>>>
>>>>>>> rely on these <c:imports...  It's almost impossible for us to
>>>>>>> manually go over each one of these jsp pages and add the <%@ page
>>>>>>> session="false"%> line to each of them.  Can you think of an an
>>>>>>> easier solution to my problem?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Yes, take advantage that this is OSS and patch your Tomcat
>>>>>
>>>>>
>>>>>
>>>>> ;) Or use
>>>>>
>>>>>> the replacement class (put in
>>>>>> server/classes/org/apache/catalina/core).
>>>>>>
>>>>>> -- 
>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>> Remy Maucherat
>>>>>> Developer & Consultant
>>>>>> JBoss Group (Europe) SaRL
>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>
>>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>
>>>>>
>>>>>> 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
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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.or
>>> g
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> 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


Re: cross context include

Posted by Aadi Deshpande <ma...@clubmom-inc.com>.
More research...once the context gets set in a c:import, it seems like 
that's the way it's stuck for the life of the HttpRequest.  ..

i.e. in my example below..
    if i start at page Z, the context always remains as 'a'
    if I start at page X, the context always remains as 'b'

so it looks like tomcat can't handle more than one context switch, maybe 
because the request that is created for the initial page is the one 
that's passed down ( instead of a separate internal request being 
created for the import )

Any more thoughts?


Aadi Deshpande wrote:

> I've been struggling with the same problem.  I read the bug report, 
> but it only adresses part of the problem, the part that doesn't 
> retrieve the
>
> session properly.  I actually patched the code independently and have 
> discovered another problem, that somehow sessions are either getting 
> lost or mixed up when you do cross context imports  in at least one 
> advanced scenario :
>
> 1) page Z in context 'a' import a page X from context 'b'
> 2) page X in context 'b' imports a page Y in context 'a'
>
> in this case, the session that was created when you import page X in 
> context b is the session that's available in page Y in context a.
>
> here's my test case  ---
>
> test_page1.jsp ( context '/profile' ) :
>
>    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>    Test of cross context imports :
>    <% request.getSession().setAttribute("test_attrib", "12345"); %>
>    <% out.println("test_attrib in ( test_page1.jsp ) is " +
>    session.getAttribute("test_attrib") ); %><br/>
>    <% out.println("session id (  in test_page1.jsp) is : " +
>    request.getSession().getId() ); %> <br/>
>    <c:import url="/test_other.jsp" context="/" />
>
> test_other.jsp ( context '/' ) :
>
>    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>    <% request.getSession().setAttribute("test_other_attrib", "54321" );
> %>
>    <% out.println("test attrib ( in test_other.jsp ) is : " +
>    request.getSession().getAttribute("test_attrib") ); %><br/>
>    <% out.println("test other attrib ( in test_other.jsp) is : " +
>    request.getSession().getAttribute("test_other_attrib") ); %><br/>
>    <% out.println("session id (  in test_other.jsp) is : " +
>    request.getSession().getId() ); %> <br/>
>    <c:import url="/test_page2.jsp" context="/profile"/>
>
> test_page2.jsp ( context '/profile' ) :
>
>    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>    <% out.println("test_attrib ( in test_page2.jsp ) is " +
>    session.getAttribute("test_attrib") ); %> <br/>
>    <% out.println("test other attrib ( in test_page2.jsp) is : " +
>    request.getSession().getAttribute("test_other_attrib") ); %> <br/>
>    <% out.println("session id (  in test_page2.jsp) is : " +
>    request.getSession().getId() ); %> <br/>
>
>
>
> The output i get when I hit test_page1.jsp is :
>
>
> Test of cross context imports : test_attrib in ( test_page1.jsp ) is
> 12345
> session id ( in test_page1.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
> test attrib ( in test_other.jsp ) is : null
> test other attrib ( in test_other.jsp) is : 54321
> session id ( in test_other.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
> test_attrib ( in test_page2.jsp ) is null
> test other attrib ( in test_page2.jsp) is : 54321
> session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
>
>
> The output I get when i hit test_other.jsp is :
>
>
> test attrib ( in test_other.jsp ) is : null
> test other attrib ( in test_other.jsp) is : 54321
> session id ( in test_other.jsp) is : 55B2068D3011D727DF15068ADAD713E2
> test_attrib ( in test_page2.jsp ) is null
> test other attrib ( in test_page2.jsp) is : null
> session id ( in test_page2.jsp) is : 55B2068D3011D727DF15068ADAD713E2
>
>
> the output that i get when i hit test_page2.jsp :
>
> test_attrib ( in test_page2.jsp ) is 12345
> test other attrib ( in test_page2.jsp) is : null
> session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
>
>
> Any hints on how to resolve it?
>
>
> Asim Alp wrote:
>
>> If indeed we need to put it on all pages, then yes, it's no problem.  
>> We do have a couple perl geniuses on staff :)  I'm sure we'll find a 
>> way to get around it.
>>
>> My main concern right now is to to understand the reason of the 
>> problem first.  I read the bug report, but still can't understand why 
>> an extra session prevents our c:imports from working?
>>
>> Asim
>>
>> On Mar 2, 2004, at 1:46 PM, Mike Curwen wrote:
>>
>>> If you have a perl genius on staff, he can do ALL pages with a single
>>> command.  Scary stuff, but cool when it works. :)
>>>
>>>> -----Original Message-----
>>>> From: Asim Alp [mailto:dev.list@educationalnetworks.net]
>>>> Sent: Tuesday, March 02, 2004 12:33 PM
>>>> To: Tomcat Users List
>>>> Subject: Re: cross context include
>>>>
>>>>
>>>> I guess we'll have to find a way of going over the 10,000+ pages.
>>>> Maybe we can write a small program to automate it.  I don't
>>>> like dirty
>>>> solutions :)  If this is indeed a bug in our software, it
>>>> should better
>>>> be fixed.
>>>>
>>>> One last question though.  As much as I know, setting page session
>>>
> to
>
>>>> false only means that there is no need to create an
>>>> additional session.
>>>>   What's this have to do with c:imports?  Why does an
>>>> additional session
>>>> prevent our c:imports?
>>>>
>>>> Asim
>>>>
>>>> On Mar 2, 2004, at 1:15 PM, Remy Maucherat wrote:
>>>>
>>>>> Asim Alp wrote:
>>>>>
>>>>>> Thank you for your prompt replies.  I just read the bug, and
>>>>>> understood what the problem was.
>>>>>> Now, though, I have another question.  Is there a way of
>>>>>
>>>>>
>>>> setting page
>>>>
>>>>>> session to false at a higher level.  For example somewhere
>>>>>
>>>>>
>>>> from the
>>>>
>>>>>> server.xml file?  My problem is that we have over 100
>>>>>
>>>>>
>>>> websites with
>>>>
>>>>>> tens of thousands of jsp pages.  Every single one of these
>>>>>
>>>>>
>>>> JSP pages
>>>>
>>>>>> rely on these <c:imports...  It's almost impossible for us to
>>>>>> manually go over each one of these jsp pages and add the <%@ page
>>>>>> session="false"%> line to each of them.  Can you think of an an
>>>>>> easier solution to my problem?
>>>>>
>>>>>
>>>>>
>>>>> Yes, take advantage that this is OSS and patch your Tomcat
>>>>
>>>>
>>>> ;) Or use
>>>>
>>>>> the replacement class (put in
>>>>> server/classes/org/apache/catalina/core).
>>>>>
>>>>> -- 
>>>>> xxxxxxxxxxxxxxxxxxxxxxxxx
>>>>> Remy Maucherat
>>>>> Developer & Consultant
>>>>> JBoss Group (Europe) SaRL
>>>>> xxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>
>>>>>
>>>>
> ---------------------------------------------------------------------
>
>>>>
>>>>> 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
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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.or
>> g
>
>
>
>


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


Re: cross context include

Posted by Aadi Deshpande <ma...@clubmom-inc.com>.
I've been struggling with the same problem.  I read the bug report, but 
it only adresses part of the problem, the part that doesn't retrieve the 
session properly.  I actually patched the code independently and have 
discovered another problem, that somehow sessions are either getting 
lost or mixed up when you do cross context imports  in at least one 
advanced scenario :

1) page Z in context 'a' import a page X from context 'b'
2) page X in context 'b' imports a page Y in context 'a'

in this case, the session that was created when you import page X in 
context b is the session that's available in page Y in context a.

here's my test case  ---

test_page1.jsp ( context '/profile' ) :

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    Test of cross context imports :
    <% request.getSession().setAttribute("test_attrib", "12345"); %>
    <% out.println("test_attrib in ( test_page1.jsp ) is " +
    session.getAttribute("test_attrib") ); %><br/>
    <% out.println("session id (  in test_page1.jsp) is : " +
    request.getSession().getId() ); %> <br/>
    <c:import url="/test_other.jsp" context="/" />

test_other.jsp ( context '/' ) :

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <% request.getSession().setAttribute("test_other_attrib", "54321" ); %>
    <% out.println("test attrib ( in test_other.jsp ) is : " +
    request.getSession().getAttribute("test_attrib") ); %><br/>
    <% out.println("test other attrib ( in test_other.jsp) is : " +
    request.getSession().getAttribute("test_other_attrib") ); %><br/>
    <% out.println("session id (  in test_other.jsp) is : " +
    request.getSession().getId() ); %> <br/>
    <c:import url="/test_page2.jsp" context="/profile"/>

test_page2.jsp ( context '/profile' ) :

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <% out.println("test_attrib ( in test_page2.jsp ) is " +
    session.getAttribute("test_attrib") ); %> <br/>
    <% out.println("test other attrib ( in test_page2.jsp) is : " +
    request.getSession().getAttribute("test_other_attrib") ); %> <br/>
    <% out.println("session id (  in test_page2.jsp) is : " +
    request.getSession().getId() ); %> <br/>



The output i get when I hit test_page1.jsp is :


Test of cross context imports : test_attrib in ( test_page1.jsp ) is 12345
session id ( in test_page1.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
test attrib ( in test_other.jsp ) is : null
test other attrib ( in test_other.jsp) is : 54321
session id ( in test_other.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F
test_attrib ( in test_page2.jsp ) is null
test other attrib ( in test_page2.jsp) is : 54321
session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F


The output I get when i hit test_other.jsp is :


test attrib ( in test_other.jsp ) is : null
test other attrib ( in test_other.jsp) is : 54321
session id ( in test_other.jsp) is : 55B2068D3011D727DF15068ADAD713E2
test_attrib ( in test_page2.jsp ) is null
test other attrib ( in test_page2.jsp) is : null
session id ( in test_page2.jsp) is : 55B2068D3011D727DF15068ADAD713E2


the output that i get when i hit test_page2.jsp :

test_attrib ( in test_page2.jsp ) is 12345
test other attrib ( in test_page2.jsp) is : null
session id ( in test_page2.jsp) is : 2796EBFF6C413841B7B2D496D7E8FD3F


Any hints on how to resolve it?


Asim Alp wrote:

> If indeed we need to put it on all pages, then yes, it's no problem.  
> We do have a couple perl geniuses on staff :)  I'm sure we'll find a 
> way to get around it.
>
> My main concern right now is to to understand the reason of the 
> problem first.  I read the bug report, but still can't understand why 
> an extra session prevents our c:imports from working?
>
> Asim
>
> On Mar 2, 2004, at 1:46 PM, Mike Curwen wrote:
>
>> If you have a perl genius on staff, he can do ALL pages with a single
>> command.  Scary stuff, but cool when it works. :)
>>
>>> -----Original Message-----
>>> From: Asim Alp [mailto:dev.list@educationalnetworks.net]
>>> Sent: Tuesday, March 02, 2004 12:33 PM
>>> To: Tomcat Users List
>>> Subject: Re: cross context include
>>>
>>>
>>> I guess we'll have to find a way of going over the 10,000+ pages.
>>> Maybe we can write a small program to automate it.  I don't
>>> like dirty
>>> solutions :)  If this is indeed a bug in our software, it
>>> should better
>>> be fixed.
>>>
>>> One last question though.  As much as I know, setting page session to
>>> false only means that there is no need to create an
>>> additional session.
>>>   What's this have to do with c:imports?  Why does an
>>> additional session
>>> prevent our c:imports?
>>>
>>> Asim
>>>
>>> On Mar 2, 2004, at 1:15 PM, Remy Maucherat wrote:
>>>
>>>> Asim Alp wrote:
>>>>
>>>>> Thank you for your prompt replies.  I just read the bug, and
>>>>> understood what the problem was.
>>>>> Now, though, I have another question.  Is there a way of
>>>>
>>> setting page
>>>
>>>>> session to false at a higher level.  For example somewhere
>>>>
>>> from the
>>>
>>>>> server.xml file?  My problem is that we have over 100
>>>>
>>> websites with
>>>
>>>>> tens of thousands of jsp pages.  Every single one of these
>>>>
>>> JSP pages
>>>
>>>>> rely on these <c:imports...  It's almost impossible for us to
>>>>> manually go over each one of these jsp pages and add the <%@ page
>>>>> session="false"%> line to each of them.  Can you think of an an
>>>>> easier solution to my problem?
>>>>
>>>>
>>>> Yes, take advantage that this is OSS and patch your Tomcat
>>>
>>> ;) Or use
>>>
>>>> the replacement class (put in
>>>> server/classes/org/apache/catalina/core).
>>>>
>>>> -- 
>>>> xxxxxxxxxxxxxxxxxxxxxxxxx
>>>> Rémy Maucherat
>>>> Developer & Consultant
>>>> JBoss Group (Europe) SàRL
>>>> xxxxxxxxxxxxxxxxxxxxxxxxx
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>>
>>>> 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
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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.or
> g



Re: cross context include

Posted by Asim Alp <de...@educationalnetworks.net>.
If indeed we need to put it on all pages, then yes, it's no problem.  
We do have a couple perl geniuses on staff :)  I'm sure we'll find a 
way to get around it.

My main concern right now is to to understand the reason of the problem 
first.  I read the bug report, but still can't understand why an extra 
session prevents our c:imports from working?

Asim

On Mar 2, 2004, at 1:46 PM, Mike Curwen wrote:

> If you have a perl genius on staff, he can do ALL pages with a single
> command.  Scary stuff, but cool when it works. :)
>
>> -----Original Message-----
>> From: Asim Alp [mailto:dev.list@educationalnetworks.net]
>> Sent: Tuesday, March 02, 2004 12:33 PM
>> To: Tomcat Users List
>> Subject: Re: cross context include
>>
>>
>> I guess we'll have to find a way of going over the 10,000+ pages.
>> Maybe we can write a small program to automate it.  I don't
>> like dirty
>> solutions :)  If this is indeed a bug in our software, it
>> should better
>> be fixed.
>>
>> One last question though.  As much as I know, setting page session to
>> false only means that there is no need to create an
>> additional session.
>>   What's this have to do with c:imports?  Why does an
>> additional session
>> prevent our c:imports?
>>
>> Asim
>>
>> On Mar 2, 2004, at 1:15 PM, Remy Maucherat wrote:
>>
>>> Asim Alp wrote:
>>>
>>>> Thank you for your prompt replies.  I just read the bug, and
>>>> understood what the problem was.
>>>> Now, though, I have another question.  Is there a way of
>> setting page
>>>> session to false at a higher level.  For example somewhere
>> from the
>>>> server.xml file?  My problem is that we have over 100
>> websites with
>>>> tens of thousands of jsp pages.  Every single one of these
>> JSP pages
>>>> rely on these <c:imports...  It's almost impossible for us to
>>>> manually go over each one of these jsp pages and add the <%@ page
>>>> session="false"%> line to each of them.  Can you think of an an
>>>> easier solution to my problem?
>>>
>>> Yes, take advantage that this is OSS and patch your Tomcat
>> ;) Or use
>>> the replacement class (put in
>>> server/classes/org/apache/catalina/core).
>>>
>>> --
>>> xxxxxxxxxxxxxxxxxxxxxxxxx
>>> Rémy Maucherat
>>> Developer & Consultant
>>> JBoss Group (Europe) SàRL
>>> xxxxxxxxxxxxxxxxxxxxxxxxx
>>>
>>>
>> ---------------------------------------------------------------------
>>> 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
>>
>
>
> ---------------------------------------------------------------------
> 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


RE: cross context include

Posted by Mike Curwen <gb...@gb-im.com>.
If you have a perl genius on staff, he can do ALL pages with a single
command.  Scary stuff, but cool when it works. :)

> -----Original Message-----
> From: Asim Alp [mailto:dev.list@educationalnetworks.net] 
> Sent: Tuesday, March 02, 2004 12:33 PM
> To: Tomcat Users List
> Subject: Re: cross context include
> 
> 
> I guess we'll have to find a way of going over the 10,000+ pages.  
> Maybe we can write a small program to automate it.  I don't 
> like dirty 
> solutions :)  If this is indeed a bug in our software, it 
> should better 
> be fixed.
> 
> One last question though.  As much as I know, setting page session to 
> false only means that there is no need to create an 
> additional session. 
>   What's this have to do with c:imports?  Why does an 
> additional session 
> prevent our c:imports?
> 
> Asim
> 
> On Mar 2, 2004, at 1:15 PM, Remy Maucherat wrote:
> 
> > Asim Alp wrote:
> >
> >> Thank you for your prompt replies.  I just read the bug, and
> >> understood what the problem was.
> >> Now, though, I have another question.  Is there a way of 
> setting page 
> >> session to false at a higher level.  For example somewhere 
> from the 
> >> server.xml file?  My problem is that we have over 100 
> websites with 
> >> tens of thousands of jsp pages.  Every single one of these 
> JSP pages 
> >> rely on these <c:imports...  It's almost impossible for us to 
> >> manually go over each one of these jsp pages and add the <%@ page 
> >> session="false"%> line to each of them.  Can you think of an an 
> >> easier solution to my problem?
> >
> > Yes, take advantage that this is OSS and patch your Tomcat 
> ;) Or use 
> > the replacement class (put in 
> > server/classes/org/apache/catalina/core).
> >
> > --
> > xxxxxxxxxxxxxxxxxxxxxxxxx
> > Rémy Maucherat
> > Developer & Consultant
> > JBoss Group (Europe) SàRL
> > xxxxxxxxxxxxxxxxxxxxxxxxx
> >
> > 
> ---------------------------------------------------------------------
> > 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
> 


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


Re: cross context include

Posted by Asim Alp <de...@educationalnetworks.net>.
I guess we'll have to find a way of going over the 10,000+ pages.  
Maybe we can write a small program to automate it.  I don't like dirty 
solutions :)  If this is indeed a bug in our software, it should better 
be fixed.

One last question though.  As much as I know, setting page session to 
false only means that there is no need to create an additional session. 
  What's this have to do with c:imports?  Why does an additional session 
prevent our c:imports?

Asim

On Mar 2, 2004, at 1:15 PM, Remy Maucherat wrote:

> Asim Alp wrote:
>
>> Thank you for your prompt replies.  I just read the bug, and 
>> understood what the problem was.
>> Now, though, I have another question.  Is there a way of setting page 
>> session to false at a higher level.  For example somewhere from the 
>> server.xml file?  My problem is that we have over 100 websites with 
>> tens of thousands of jsp pages.  Every single one of these JSP pages 
>> rely on these <c:imports...  It's almost impossible for us to 
>> manually go over each one of these jsp pages and add the <%@ page 
>> session="false"%> line to each of them.  Can you think of an an 
>> easier solution to my problem?
>
> Yes, take advantage that this is OSS and patch your Tomcat ;)
> Or use the replacement class (put in 
> server/classes/org/apache/catalina/core).
>
> -- 
> xxxxxxxxxxxxxxxxxxxxxxxxx
> Rémy Maucherat
> Developer & Consultant
> JBoss Group (Europe) SàRL
> xxxxxxxxxxxxxxxxxxxxxxxxx
>
> ---------------------------------------------------------------------
> 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


Re: cross context include

Posted by Remy Maucherat <re...@jboss.org>.
Asim Alp wrote:

> Thank you for your prompt replies.  I just read the bug, and understood 
> what the problem was.
> 
> Now, though, I have another question.  Is there a way of setting page 
> session to false at a higher level.  For example somewhere from the 
> server.xml file?  My problem is that we have over 100 websites with tens 
> of thousands of jsp pages.  Every single one of these JSP pages rely on 
> these <c:imports...  It's almost impossible for us to manually go over 
> each one of these jsp pages and add the <%@ page session="false"%> line 
> to each of them.  Can you think of an an easier solution to my problem?

Yes, take advantage that this is OSS and patch your Tomcat ;)
Or use the replacement class (put in 
server/classes/org/apache/catalina/core).

-- 
xxxxxxxxxxxxxxxxxxxxxxxxx
Rémy Maucherat
Developer & Consultant
JBoss Group (Europe) SàRL
xxxxxxxxxxxxxxxxxxxxxxxxx


Re: cross context include

Posted by Asim Alp <de...@educationalnetworks.net>.
Thank you for your prompt replies.  I just read the bug, and understood 
what the problem was.

Now, though, I have another question.  Is there a way of setting page 
session to false at a higher level.  For example somewhere from the 
server.xml file?  My problem is that we have over 100 websites with 
tens of thousands of jsp pages.  Every single one of these JSP pages 
rely on these <c:imports...  It's almost impossible for us to manually 
go over each one of these jsp pages and add the <%@ page 
session="false"%> line to each of them.  Can you think of an an easier 
solution to my problem?

Thanks,

Asim

On Mar 2, 2004, at 12:40 PM, Remy Maucherat wrote:

> Asim Alp wrote:
>> When I replace /hello.jsp with the following:
>> <%@ page session="false"%>
>> Hello World!
>> The output on Tomcat 5.0.19 becomes:
>> This is test.jsp
>> Hello World!
>> Isn't this weird?
>
> No. See bug 27309.
>
> -- 
> xxxxxxxxxxxxxxxxxxxxxxxxx
> Rémy Maucherat
> Developer & Consultant
> JBoss Group (Europe) SàRL
> xxxxxxxxxxxxxxxxxxxxxxxxx
>
> ---------------------------------------------------------------------
> 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


Re: cross context include

Posted by Remy Maucherat <re...@jboss.org>.
Asim Alp wrote:
> When I replace /hello.jsp with the following:
> <%@ page session="false"%>
> Hello World!
> 
> The output on Tomcat 5.0.19 becomes:
> This is test.jsp
> Hello World!
> 
> 
> Isn't this weird?

No. See bug 27309.

-- 
xxxxxxxxxxxxxxxxxxxxxxxxx
Rémy Maucherat
Developer & Consultant
JBoss Group (Europe) SàRL
xxxxxxxxxxxxxxxxxxxxxxxxx

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


Re: cross context include

Posted by Asim Alp <de...@educationalnetworks.net>.
I noticed something interesting.  I tried your example using 
/dates/date.jsp in the jsp-examples context.  It worked.

I opened date.jsp and noticed the line: <%@ page session="false"%> at 
the top of it.

I pasted this line in my hello.jsp and it worked.  Any idea why I need 
this line on Tomcat 5.0.19, but not on 5.0.18?

So, to clarify things:

/test.jsp in context "":
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
This is test.jsp<br><br>
<c:import url="/hello.jsp" context="/jsp-apps" />

/hello.jsp in context "jsp-apps":
Hello World!

The output of /test.jsp on Tomcat 5.0.18 is:
This is test.jsp
Hello World!

The output of the same file on Tomcat 5.0.19 is:
This is test.jsp


When I replace /hello.jsp with the following:
<%@ page session="false"%>
Hello World!

The output on Tomcat 5.0.19 becomes:
This is test.jsp
Hello World!


Isn't this weird?

Asim


On Mar 2, 2004, at 12:04 PM, Asim Alp wrote:

> I found the reason of the previous error message.  However, I'm still 
> having a problem.  This time my <c:import ... tag doesn't load 
> anything at all.
>
> Here is my setup:
>
> /test.jsp (context "")
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> This is test.jsp<br><br>
> <c:import url="/hello.jsp" context="/jsp-apps" />
>
> /hello.jsp (context /jsp-apps)
> Hello World!<br>
>
> When I view /test.jsp, I only get:
> This is test.jsp
>
> In my browser.
>
> I tried one more thing.  I replaced test.jsp with the following:
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> This is test.jsp<br><br>
> <c:import url="http://www.yahoo.com" />
>
> It worked!  I got a page that says "This is test.jsp" at the top 
> followed by the frontpage of yahoo.com.
>
> Any suggestions?
>
> Asim
>
> On Mar 2, 2004, at 11:45 AM, Remy Maucherat wrote:
>
>> Asim Alp wrote:
>>> My application was running without any problems on Tomcat 5.0.18.   
>>> After upgrading to Tomcat 5.0.19, I started having problems with my  
>>> cross context includes.  I haven't changed a single line of code.   
>>> Server.xml is the same as well.  Here is the host section on my  
>>> server.xml:
>>> <Host name="www.domain1.com" debug="0" appBase="webapps/domains"  
>>> unpackWARs="true" autoDeploy="true" xmlValidation="false"  
>>> xmlNamespaceAware="false">
>>>     <Logger    className="org.apache.catalina.logger.FileLogger"  
>>> directory="logs" prefix="BXSCI_" suffix=".log" timestamp="true"/>
>>>                <Context path="" docBase="domain1" debug="0" 
>>> crossContext="true"  caseSensitive="false" />
>>>     <Context path="/jsp-apps" docBase="jsp-apps" debug="0"  
>>> crossContext="true" caseSensitive="false" />
>>> </Host>
>>> In the "/" context, my index.jsp is as follows:
>>> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
>>> <c:import url="/shared/header.jsp" context="/jsp-apps" />
>>> .....
>>
>> I tried it and it works for me.
>> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
>> Foo1<br>
>> <c:import url="/dates/date.jsp" context="/jsp-examples" />
>> <br>Foo2
>>
>> Your context needs to be crossContext, of course.
>>
>> -- 
>> xxxxxxxxxxxxxxxxxxxxxxxxx
>> Rémy Maucherat
>> Developer & Consultant
>> JBoss Group (Europe) SàRL
>> xxxxxxxxxxxxxxxxxxxxxxxxx
>>
>> ---------------------------------------------------------------------
>> 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
>


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


Re: cross context include

Posted by Asim Alp <de...@educationalnetworks.net>.
I found the reason of the previous error message.  However, I'm still 
having a problem.  This time my <c:import ... tag doesn't load anything 
at all.

Here is my setup:

/test.jsp (context "")
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
This is test.jsp<br><br>
<c:import url="/hello.jsp" context="/jsp-apps" />

/hello.jsp (context /jsp-apps)
Hello World!<br>

When I view /test.jsp, I only get:
This is test.jsp

In my browser.

I tried one more thing.  I replaced test.jsp with the following:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
This is test.jsp<br><br>
<c:import url="http://www.yahoo.com" />

It worked!  I got a page that says "This is test.jsp" at the top 
followed by the frontpage of yahoo.com.

Any suggestions?

Asim

On Mar 2, 2004, at 11:45 AM, Remy Maucherat wrote:

> Asim Alp wrote:
>> My application was running without any problems on Tomcat 5.0.18.   
>> After upgrading to Tomcat 5.0.19, I started having problems with my  
>> cross context includes.  I haven't changed a single line of code.   
>> Server.xml is the same as well.  Here is the host section on my  
>> server.xml:
>> <Host name="www.domain1.com" debug="0" appBase="webapps/domains"  
>> unpackWARs="true" autoDeploy="true" xmlValidation="false"  
>> xmlNamespaceAware="false">
>>     <Logger    className="org.apache.catalina.logger.FileLogger"  
>> directory="logs" prefix="BXSCI_" suffix=".log" timestamp="true"/>
>>                <Context path="" docBase="domain1" debug="0" 
>> crossContext="true"  caseSensitive="false" />
>>     <Context path="/jsp-apps" docBase="jsp-apps" debug="0"  
>> crossContext="true" caseSensitive="false" />
>> </Host>
>> In the "/" context, my index.jsp is as follows:
>> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
>> <c:import url="/shared/header.jsp" context="/jsp-apps" />
>> .....
>
> I tried it and it works for me.
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> Foo1<br>
> <c:import url="/dates/date.jsp" context="/jsp-examples" />
> <br>Foo2
>
> Your context needs to be crossContext, of course.
>
> -- 
> xxxxxxxxxxxxxxxxxxxxxxxxx
> Rémy Maucherat
> Developer & Consultant
> JBoss Group (Europe) SàRL
> xxxxxxxxxxxxxxxxxxxxxxxxx
>
> ---------------------------------------------------------------------
> 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


Re: cross context include

Posted by Remy Maucherat <re...@jboss.org>.
Asim Alp wrote:
> My application was running without any problems on Tomcat 5.0.18.   
> After upgrading to Tomcat 5.0.19, I started having problems with my  
> cross context includes.  I haven't changed a single line of code.   
> Server.xml is the same as well.  Here is the host section on my  
> server.xml:
> 
> <Host name="www.domain1.com" debug="0" appBase="webapps/domains"  
> unpackWARs="true" autoDeploy="true" xmlValidation="false"  
> xmlNamespaceAware="false">
>     <Logger    className="org.apache.catalina.logger.FileLogger"  
> directory="logs" prefix="BXSCI_" suffix=".log" timestamp="true"/>
>            
>     <Context path="" docBase="domain1" debug="0" crossContext="true"  
> caseSensitive="false" />
>     <Context path="/jsp-apps" docBase="jsp-apps" debug="0"  
> crossContext="true" caseSensitive="false" />
> </Host>
> 
> In the "/" context, my index.jsp is as follows:
> 
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> <c:import url="/shared/header.jsp" context="/jsp-apps" />
> .....

I tried it and it works for me.
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
Foo1<br>
<c:import url="/dates/date.jsp" context="/jsp-examples" />
<br>Foo2

Your context needs to be crossContext, of course.

-- 
xxxxxxxxxxxxxxxxxxxxxxxxx
Rémy Maucherat
Developer & Consultant
JBoss Group (Europe) SàRL
xxxxxxxxxxxxxxxxxxxxxxxxx

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