tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arieh Markel <Arieh.Mar...@Central.Sun.COM>
Subject Re: What in the API replaces HttpServer.getDefaultContext() ?
Date Tue, 25 Jan 2000 02:16:16 GMT

> Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm
> X-No-Archive: yes
> list-help: <mailto:tomcat-dev-help@jakarta.apache.org>
> list-unsubscribe: <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> list-post: <mailto:tomcat-dev@jakarta.apache.org>
> Delivered-To: mailing list tomcat-dev@jakarta.apache.org
> From: Costin Manolache <costin@costin.dnt.ro>
> To: tomcat-dev@jakarta.apache.org
> Subject: Re: What in the API replaces HttpServer.getDefaultContext() ?
> 
> Arieh Markel wrote:
> 
> > I have been using the above mentioned method to get the default context
> > for dynamic incorporation of servlets to a running application.
> >
> > What is the recommended method(s) for its replacement ?
> >
> > Just for reference, the incorporation of the servlet has to be done 
following
> > the reception of an internal listener event that is fired when a
> > servlet-accessible class instance has been created.
> 
> You can use ContextManager.getContext("/")
> 
> You can get a ContextManager in many wais, depends on where you
> register your listener. The best way to plug it in is by using an interceptor,
> (the API is not yet finalized).

I followed your instructions.

I actually found (perhaps ambiguities), since in order to get the default
context, I had to query 

	contextManager.getContext("")
	
to get the context that I wanted.

Querying for "/" returned a null Context.

The following is the snippet of 'server.xml' that I am using.

        <Context path="/" docBase="console"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false"/>
        <Context path="/examples" docBase="examples"
            defaultSessionTimeOut="30" isWARExpanded="true"
            isWARValidated="false" isInvokerEnabled="true"
            isWorkDirPersistent="false"/>

Arieh
--
 Arieh Markel		                Sun Microsystems Inc.
 Network Storage                        500 Eldorado Blvd. MS UBRM11-194
 e-mail: arieh.markel@sun.COM           Broomfield, CO 80021
 Let's go Panthers !!!!                 Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


Mime
View raw message