Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: How to get the Context lists when the server is started

Shapira, Yoav

2003-12-24



Howdy,
The ServletContextListener is notified when a context is started (and
shut down). As the servlet specification intends for your application
to be self-contained and not know about other webapps on the server,
there's no API-standard way to get a list of contexts on the server.

You can do it using tomcat-specific code, but you probably don't want to
go that way.

You also have the ServletContext#getContext(String uripath) call, but
you need a uripath guess to use that.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: arunkumar [mailto:arunkumar@(protected)]
>Sent: Tuesday, December 23, 2003 11:36 PM
>To: tomcat-user@(protected)
>Subject: How to get the Context lists when the server is started
>
>Hi,
>  I want to get the details of the Context [Web Applications]
>initialized
>when the Tomcat is started.I tried implementing the LifecycleListener
>interface and it returns only Engine Startup Event.Is there is any
>Listeners available when the Context is initialized or any other ways
to
>find the available Contexts.
>  Is it possible to register Valves for a particular context.I
tried
>writing a class which extends ValveBase and gave an entry for the Valve
>in the server.xml after the Context tag.But all the requests are coming
>through this Valve.
>
>Thanks,
>Arun kumar
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
>For additional commands, e-mail: tomcat-user-help@(protected)




This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.