You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jonathan Perry <jo...@yahoo.com> on 2002/06/04 10:51:56 UTC

CrossContext

Hi,
    I'm running jakarta-tomcat-4.0.3 on Mac OSX.  I've got two contexts set
up, "A", and "B".  Both have crossContext="true" in their section of
server.xml.  I have a copy of a servlet in each context, which has the
following lines of code:

ServletContext c = getServletContext( ).getContext( "/A/" );
RequestDispatcher dispatcher = c.getRequestDispatcher( "/helloWorld.jsp" );

This code works as expected in context A, but fails to obtain a context
(simply returning null, no exceptions thrown) in context B.  I've searched
through archives on several sites, including this one, and haven't found
anything promising.  Does anyone have any ideas of what I might be doing
wrong?

Thanks for your time,
JP


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: CrossContext

Posted by Phillip Morelock <su...@phillipmorelock.com>.
>From the servlet api:

    Returns a ServletContext object that corresponds to a specified URL on
the server.

    This method allows servlets to gain access to the context for various
parts of the server, and as needed obtain RequestDispatcher objects from the
context. The given path must be begin with "/", is interpreted relative to
the server's document root and is matched against the context roots of other
web applications hosted on this container.

In a security conscious environment, the servlet container may return null
for a given URL.

Parameters:
uripath - a String specifying the context path of another web application in
the container.Returns:
the ServletContext object that corresponds to the named URL, or null if
either none exists or the container wishes to restrict this access.

Is it possible that tomcat returns null by default?  I started digging
through source for you, but you might have to do some more digging.

I checked the source for:
org.apache.catalina.core.StandardContext

Notice this interesting source comment (I don't know where it gets set at
runtime, however):
 /**
     * Should we allow the <code>ServletContext.getContext()</code> method
     * to access the context of other web applications in this server?
     */
    private boolean crossContext = false;

 and also some getters and setters:
/**
     * Return the "allow crossing servlet contexts" flag.
     */
    public boolean getCrossContext() {

        return (this.crossContext);

    }


    /**
     * Set the "allow crossing servlet contexts" flag.
     *
     * @param crossContext The new cross contexts flag
     */
    public void setCrossContext(boolean crossContext) {

        boolean oldCrossContext = this.crossContext;
        this.crossContext = crossContext;
        support.firePropertyChange("crossContext",
                                   new Boolean(oldCrossContext),
                                   new Boolean(this.crossContext));

    }


You should definitely take a look at
org.apache.catalina.core.ApplicationContext.java

since it implements ServletContext for tomcat -- that will show you where to
trace the source path.  it also has an interesting inner class at the top
called :

 protected class PrivilegedGetRequestDispatcher
        implements PrivilegedAction {


good luck
fillup



On 6/4/02 2:44 PM, "Jonathan Perry" <jo...@yahoo.com> wrote:

> Anybody?  Please?  This is really doing my head in.
> 
> Thanks a lot,
> JP
> 
> On 4/6/02 10:51 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
> 
>> Hi,
>>   I'm running jakarta-tomcat-4.0.3 on Mac OSX.  I've got two contexts set
>> up, "A", and "B".  Both have crossContext="true" in their section of
>> server.xml.  I have a copy of a servlet in each context, which has the
>> following lines of code:
>> 
>> ServletContext c = getServletContext( ).getContext( "/A/" );
>> RequestDispatcher dispatcher = c.getRequestDispatcher( "/helloWorld.jsp" );
>> 
>> This code works as expected in context A, but fails to obtain a context
>> (simply returning null, no exceptions thrown) in context B.  I've searched
>> through archives on several sites, including this one, and haven't found
>> anything promising.  Does anyone have any ideas of what I might be doing
>> wrong?
>> 
>> Thanks for your time,
>> JP
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: CrossContext

Posted by Umberto Nicoletti <un...@arpa.veneto.it>.
Hi Jonathan,
I know the Eclipse IDE (www.eclipse.org) can be use to hot debug
programs.
Also I know it's possible to run Tomcat from inside the IDE so maybe
you'd want to look into that...

Good luck,
Umberto

Jonathan Perry wrote:
> 
> I'm at a loss of how to debug this.  Does anyone have any ideas of what to
> do?
> 
> Thanks,
> JP
> 
> On 5/6/02 11:45 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
> 
> > So having downloaded the source, built it, included it in my classpath (and
> > then, of course, discovered I had already done all this when I first built
> > tomcat, Duh...), and stared at it for a while, I'm not too sure how to check
> > that the crossContext attribute is getting through at all: the
> > ApplicationContextFacade that gets passed back by tomcat in response to
> > getContext( ) doesn't have any ways in, and I can't see any other ways in
> > that aren't private/protected.  Most frustrating.  Anyone have any ideas?
> >
> > Thanks,
> > JP
> >
> > On 5/6/02 9:09 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
> >
> >> Didn't seem to make a difference.
> >>
> >> I'm downloading the source, as I should have before I asked anyone...  No
> >> doubt I'll have further questions.
> >>
> >> Thanks,
> >> JP
> >>
> >> On 5/6/02 12:53 am, "Phillip Morelock" <su...@phillipmorelock.com>
> >> wrote:
> >>
> >>> Are you supposed to have the trailing slash?
> >>>
> >>> maybe:
> >>> getServletContext( ).getContext( "/A" )
> >>>
> >>> I haven't used this feature, just trying to help.
> >>>
> >>> fillup
> >>>
> >>>
> >>> On 6/4/02 2:44 PM, "Jonathan Perry" <jo...@yahoo.com> wrote:
> >>>
> >>>> Anybody?  Please?  This is really doing my head in.
> >>>>
> >>>> Thanks a lot,
> >>>> JP
> >>>>
> >>>> On 4/6/02 10:51 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
> >>>>
> >>>>> Hi,
> >>>>>   I'm running jakarta-tomcat-4.0.3 on Mac OSX.  I've got two contexts set
> >>>>> up, "A", and "B".  Both have crossContext="true" in their section of
> >>>>> server.xml.  I have a copy of a servlet in each context, which has the
> >>>>> following lines of code:
> >>>>>
> >>>>> ServletContext c = getServletContext( ).getContext( "/A/" );
> >>>>> RequestDispatcher dispatcher = c.getRequestDispatcher( "/helloWorld.jsp"
> >>>>> );
> >>>>>
> >>>>> This code works as expected in context A, but fails to obtain a context
> >>>>> (simply returning null, no exceptions thrown) in context B.  I've searched
> >>>>> through archives on several sites, including this one, and haven't found
> >>>>> anything promising.  Does anyone have any ideas of what I might be doing
> >>>>> wrong?
> >>>>>
> >>>>> Thanks for your time,
> >>>>> JP
> >>>>>
> >>>>>
> >>>>> --
> >>>>> To unsubscribe, e-mail:
> >>>>> <ma...@jakarta.apache.org>
> >>>>> For additional commands, e-mail:
> >>>>> <ma...@jakarta.apache.org>
> >>>>
> >>>>
> >>>> --
> >>>> To unsubscribe, e-mail:
> >>>> <ma...@jakarta.apache.org>
> >>>> For additional commands, e-mail:
> >>>> <ma...@jakarta.apache.org>
> >>>>
> >>>
> >>>
> >>> --
> >>> To unsubscribe, e-mail:
> >>> <ma...@jakarta.apache.org>
> >>> For additional commands, e-mail:
> >>> <ma...@jakarta.apache.org>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >> For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 
Umberto Nicoletti - unicoletti@arpa.veneto.it | sysmaster@arpa.veneto.it
Tel. 049-8239380 (assistenza)

"We'll try to make different mistakes this time." - Larry Wall

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: CrossContext

Posted by anette mysel <ca...@cox.net>.
PLEASE REMOVE ME FROM YOUR MAILING LIST. I DO NOT KNOW YOU. TAHNK YOU...
----- Original Message -----
From: "Jonathan Perry" <jo...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, June 05, 2002 7:25 AM
Subject: Re: CrossContext


> I'm at a loss of how to debug this.  Does anyone have any ideas of what to
> do?
>
> Thanks,
> JP
>
> On 5/6/02 11:45 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
>
> > So having downloaded the source, built it, included it in my classpath
(and
> > then, of course, discovered I had already done all this when I first
built
> > tomcat, Duh...), and stared at it for a while, I'm not too sure how to
check
> > that the crossContext attribute is getting through at all: the
> > ApplicationContextFacade that gets passed back by tomcat in response to
> > getContext( ) doesn't have any ways in, and I can't see any other ways
in
> > that aren't private/protected.  Most frustrating.  Anyone have any
ideas?
> >
> > Thanks,
> > JP
> >
> > On 5/6/02 9:09 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
> >
> >> Didn't seem to make a difference.
> >>
> >> I'm downloading the source, as I should have before I asked anyone...
No
> >> doubt I'll have further questions.
> >>
> >> Thanks,
> >> JP
> >>
> >> On 5/6/02 12:53 am, "Phillip Morelock"
<su...@phillipmorelock.com>
> >> wrote:
> >>
> >>> Are you supposed to have the trailing slash?
> >>>
> >>> maybe:
> >>> getServletContext( ).getContext( "/A" )
> >>>
> >>> I haven't used this feature, just trying to help.
> >>>
> >>> fillup
> >>>
> >>>
> >>> On 6/4/02 2:44 PM, "Jonathan Perry" <jo...@yahoo.com> wrote:
> >>>
> >>>> Anybody?  Please?  This is really doing my head in.
> >>>>
> >>>> Thanks a lot,
> >>>> JP
> >>>>
> >>>> On 4/6/02 10:51 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
> >>>>
> >>>>> Hi,
> >>>>>   I'm running jakarta-tomcat-4.0.3 on Mac OSX.  I've got two
contexts set
> >>>>> up, "A", and "B".  Both have crossContext="true" in their section of
> >>>>> server.xml.  I have a copy of a servlet in each context, which has
the
> >>>>> following lines of code:
> >>>>>
> >>>>> ServletContext c = getServletContext( ).getContext( "/A/" );
> >>>>> RequestDispatcher dispatcher = c.getRequestDispatcher(
"/helloWorld.jsp"
> >>>>> );
> >>>>>
> >>>>> This code works as expected in context A, but fails to obtain a
context
> >>>>> (simply returning null, no exceptions thrown) in context B.  I've
searched
> >>>>> through archives on several sites, including this one, and haven't
found
> >>>>> anything promising.  Does anyone have any ideas of what I might be
doing
> >>>>> wrong?
> >>>>>
> >>>>> Thanks for your time,
> >>>>> JP
> >>>>>
> >>>>>
> >>>>> --
> >>>>> To unsubscribe, e-mail:
> >>>>> <ma...@jakarta.apache.org>
> >>>>> For additional commands, e-mail:
> >>>>> <ma...@jakarta.apache.org>
> >>>>
> >>>>
> >>>> --
> >>>> To unsubscribe, e-mail:
> >>>> <ma...@jakarta.apache.org>
> >>>> For additional commands, e-mail:
> >>>> <ma...@jakarta.apache.org>
> >>>>
> >>>
> >>>
> >>> --
> >>> To unsubscribe, e-mail:
> >>> <ma...@jakarta.apache.org>
> >>> For additional commands, e-mail:
> >>> <ma...@jakarta.apache.org>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: CrossContext

Posted by Jonathan Perry <jo...@yahoo.com>.
I'm at a loss of how to debug this.  Does anyone have any ideas of what to
do?

Thanks,
JP

On 5/6/02 11:45 am, "Jonathan Perry" <jo...@yahoo.com> wrote:

> So having downloaded the source, built it, included it in my classpath (and
> then, of course, discovered I had already done all this when I first built
> tomcat, Duh...), and stared at it for a while, I'm not too sure how to check
> that the crossContext attribute is getting through at all: the
> ApplicationContextFacade that gets passed back by tomcat in response to
> getContext( ) doesn't have any ways in, and I can't see any other ways in
> that aren't private/protected.  Most frustrating.  Anyone have any ideas?
> 
> Thanks,
> JP
> 
> On 5/6/02 9:09 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
> 
>> Didn't seem to make a difference.
>> 
>> I'm downloading the source, as I should have before I asked anyone...  No
>> doubt I'll have further questions.
>> 
>> Thanks,
>> JP
>> 
>> On 5/6/02 12:53 am, "Phillip Morelock" <su...@phillipmorelock.com>
>> wrote:
>> 
>>> Are you supposed to have the trailing slash?
>>> 
>>> maybe:
>>> getServletContext( ).getContext( "/A" )
>>> 
>>> I haven't used this feature, just trying to help.
>>> 
>>> fillup
>>> 
>>> 
>>> On 6/4/02 2:44 PM, "Jonathan Perry" <jo...@yahoo.com> wrote:
>>> 
>>>> Anybody?  Please?  This is really doing my head in.
>>>> 
>>>> Thanks a lot,
>>>> JP
>>>> 
>>>> On 4/6/02 10:51 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
>>>> 
>>>>> Hi,
>>>>>   I'm running jakarta-tomcat-4.0.3 on Mac OSX.  I've got two contexts set
>>>>> up, "A", and "B".  Both have crossContext="true" in their section of
>>>>> server.xml.  I have a copy of a servlet in each context, which has the
>>>>> following lines of code:
>>>>> 
>>>>> ServletContext c = getServletContext( ).getContext( "/A/" );
>>>>> RequestDispatcher dispatcher = c.getRequestDispatcher( "/helloWorld.jsp"
>>>>> );
>>>>> 
>>>>> This code works as expected in context A, but fails to obtain a context
>>>>> (simply returning null, no exceptions thrown) in context B.  I've searched
>>>>> through archives on several sites, including this one, and haven't found
>>>>> anything promising.  Does anyone have any ideas of what I might be doing
>>>>> wrong?
>>>>> 
>>>>> Thanks for your time,
>>>>> JP
>>>>> 
>>>>> 
>>>>> --
>>>>> To unsubscribe, e-mail:
>>>>> <ma...@jakarta.apache.org>
>>>>> For additional commands, e-mail:
>>>>> <ma...@jakarta.apache.org>
>>>> 
>>>> 
>>>> --
>>>> To unsubscribe, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> 
>>> 
>>> 
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: CrossContext

Posted by Jonathan Perry <jo...@yahoo.com>.
So having downloaded the source, built it, included it in my classpath (and
then, of course, discovered I had already done all this when I first built
tomcat, Duh...), and stared at it for a while, I'm not too sure how to check
that the crossContext attribute is getting through at all: the
ApplicationContextFacade that gets passed back by tomcat in response to
getContext( ) doesn't have any ways in, and I can't see any other ways in
that aren't private/protected.  Most frustrating.  Anyone have any ideas?

Thanks,
JP

On 5/6/02 9:09 am, "Jonathan Perry" <jo...@yahoo.com> wrote:

> Didn't seem to make a difference.
> 
> I'm downloading the source, as I should have before I asked anyone...  No
> doubt I'll have further questions.
> 
> Thanks,
> JP
> 
> On 5/6/02 12:53 am, "Phillip Morelock" <su...@phillipmorelock.com>
> wrote:
> 
>> Are you supposed to have the trailing slash?
>> 
>> maybe:
>> getServletContext( ).getContext( "/A" )
>> 
>> I haven't used this feature, just trying to help.
>> 
>> fillup
>> 
>> 
>> On 6/4/02 2:44 PM, "Jonathan Perry" <jo...@yahoo.com> wrote:
>> 
>>> Anybody?  Please?  This is really doing my head in.
>>> 
>>> Thanks a lot,
>>> JP
>>> 
>>> On 4/6/02 10:51 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
>>> 
>>>> Hi,
>>>>   I'm running jakarta-tomcat-4.0.3 on Mac OSX.  I've got two contexts set
>>>> up, "A", and "B".  Both have crossContext="true" in their section of
>>>> server.xml.  I have a copy of a servlet in each context, which has the
>>>> following lines of code:
>>>> 
>>>> ServletContext c = getServletContext( ).getContext( "/A/" );
>>>> RequestDispatcher dispatcher = c.getRequestDispatcher( "/helloWorld.jsp" );
>>>> 
>>>> This code works as expected in context A, but fails to obtain a context
>>>> (simply returning null, no exceptions thrown) in context B.  I've searched
>>>> through archives on several sites, including this one, and haven't found
>>>> anything promising.  Does anyone have any ideas of what I might be doing
>>>> wrong?
>>>> 
>>>> Thanks for your time,
>>>> JP
>>>> 
>>>> 
>>>> --
>>>> To unsubscribe, e-mail:
>>>> <ma...@jakarta.apache.org>
>>>> For additional commands, e-mail:
>>>> <ma...@jakarta.apache.org>
>>> 
>>> 
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: CrossContext

Posted by Jonathan Perry <jo...@yahoo.com>.
Didn't seem to make a difference.

I'm downloading the source, as I should have before I asked anyone...  No
doubt I'll have further questions.

Thanks,
JP

On 5/6/02 12:53 am, "Phillip Morelock" <su...@phillipmorelock.com>
wrote:

> Are you supposed to have the trailing slash?
> 
> maybe:
> getServletContext( ).getContext( "/A" )
> 
> I haven't used this feature, just trying to help.
> 
> fillup
> 
> 
> On 6/4/02 2:44 PM, "Jonathan Perry" <jo...@yahoo.com> wrote:
> 
>> Anybody?  Please?  This is really doing my head in.
>> 
>> Thanks a lot,
>> JP
>> 
>> On 4/6/02 10:51 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
>> 
>>> Hi,
>>>   I'm running jakarta-tomcat-4.0.3 on Mac OSX.  I've got two contexts set
>>> up, "A", and "B".  Both have crossContext="true" in their section of
>>> server.xml.  I have a copy of a servlet in each context, which has the
>>> following lines of code:
>>> 
>>> ServletContext c = getServletContext( ).getContext( "/A/" );
>>> RequestDispatcher dispatcher = c.getRequestDispatcher( "/helloWorld.jsp" );
>>> 
>>> This code works as expected in context A, but fails to obtain a context
>>> (simply returning null, no exceptions thrown) in context B.  I've searched
>>> through archives on several sites, including this one, and haven't found
>>> anything promising.  Does anyone have any ideas of what I might be doing
>>> wrong?
>>> 
>>> Thanks for your time,
>>> JP
>>> 
>>> 
>>> --
>>> To unsubscribe, e-mail:
>>> <ma...@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <ma...@jakarta.apache.org>
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>> For additional commands, e-mail: <ma...@jakarta.apache.org>
>> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: CrossContext

Posted by Phillip Morelock <su...@phillipmorelock.com>.
Are you supposed to have the trailing slash?

maybe:
getServletContext( ).getContext( "/A" )

I haven't used this feature, just trying to help.

fillup


On 6/4/02 2:44 PM, "Jonathan Perry" <jo...@yahoo.com> wrote:

> Anybody?  Please?  This is really doing my head in.
> 
> Thanks a lot,
> JP
> 
> On 4/6/02 10:51 am, "Jonathan Perry" <jo...@yahoo.com> wrote:
> 
>> Hi,
>>   I'm running jakarta-tomcat-4.0.3 on Mac OSX.  I've got two contexts set
>> up, "A", and "B".  Both have crossContext="true" in their section of
>> server.xml.  I have a copy of a servlet in each context, which has the
>> following lines of code:
>> 
>> ServletContext c = getServletContext( ).getContext( "/A/" );
>> RequestDispatcher dispatcher = c.getRequestDispatcher( "/helloWorld.jsp" );
>> 
>> This code works as expected in context A, but fails to obtain a context
>> (simply returning null, no exceptions thrown) in context B.  I've searched
>> through archives on several sites, including this one, and haven't found
>> anything promising.  Does anyone have any ideas of what I might be doing
>> wrong?
>> 
>> Thanks for your time,
>> JP
>> 
>> 
>> --
>> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: CrossContext

Posted by Jonathan Perry <jo...@yahoo.com>.
Anybody?  Please?  This is really doing my head in.

Thanks a lot,
JP

On 4/6/02 10:51 am, "Jonathan Perry" <jo...@yahoo.com> wrote:

> Hi,
>   I'm running jakarta-tomcat-4.0.3 on Mac OSX.  I've got two contexts set
> up, "A", and "B".  Both have crossContext="true" in their section of
> server.xml.  I have a copy of a servlet in each context, which has the
> following lines of code:
> 
> ServletContext c = getServletContext( ).getContext( "/A/" );
> RequestDispatcher dispatcher = c.getRequestDispatcher( "/helloWorld.jsp" );
> 
> This code works as expected in context A, but fails to obtain a context
> (simply returning null, no exceptions thrown) in context B.  I've searched
> through archives on several sites, including this one, and haven't found
> anything promising.  Does anyone have any ideas of what I might be doing
> wrong?
> 
> Thanks for your time,
> JP
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>