Is there any support for this in TC 4.0.4? We can't upgrade to 4.1
until it is officially released. 

Is there some way to get a handle on the ServletContext representing
ROOT? Then I can easily load the params I need. 

How about ServletContext.getContext("/") -I tried this in my init()
method, but it only returns null: 

    public void init(ServletConfig config)
        throws ServletException {

        super.init(config);

        //get this servlet's context and location
        ServletContext application = config.getServletContext();
        ServletContext root        = application.getContext("/");

        //the rest...
    }

The api docs for getContext() say: 

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

How can I know if I am hitting a security constraint? If that is the
problem, is there a way to bypass the security to allow access to the
ROOT context, but only from this one app? 

-August



--- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
> 
> 
> On Sun, 14 Jul 2002, August Detlefsen wrote:
> 
> > Date: Sun, 14 Jul 2002 23:15:53 -0700 (PDT)
> > From: August Detlefsen <[EMAIL PROTECTED]>
> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>,
> >      [EMAIL PROTECTED]
> > To: Tomcat Users List <[EMAIL PROTECTED]>
> > Subject: Cobranding - Share Controller, Split View
> >
> > I am currently developing several cobranded sites that share the
> same
> > functionality. I want to be able to share the same set of servlets
> > across multiple cobrands.
> >
> > I know I can treat the servlets as a separate webapp and deploy
> them to
> > each separate host, but if I do this, will they be able to access
> the
> > different configuration ( <context-param> and JNDI resources )
> > specified in the each ROOT context's web.xml?
> >
> 
> One way to do this in Tomcat 4.1.x is to take advantage of the
> <ResourceLink> element.  Basically, you define the resources you want
> to
> share once in the <GlobalNamingResources> section of server.xml, and
> then
> embed a <ResourceLink> for each resource in the <Context> element for
> the
> various webapps.  From the point of view of the application, it just
> looks
> like a normal application resource -- the app doesn't know that it is
> actually getting resolved to the underlying shared resource by a
> link.
> 
> This is very handy when you use the global resources to establish all
> the
> default behavior, then override just the resources a particular app
> needs
> to customize that app.  The app itself thinks of all resources as
> being
> local, so it doesn't need to be modified to look two different
> places.
> 
> > -August
> >
> 
> Craig
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to