Date: Thu, 12 Dec 2002 11:31:42 -0800
From: Sridhar Devulkar <sdev...@jacent.com>
Reply-To: Tomcat Users List <tomc...@jakarta.apache.org>
To: 'Tomcat Users List' <tomc...@jakarta.apache.org>
Subject: RE: Accessing the Context tag attributes of server.xml ...
Thanks very much for the reply.
Well, as you say, the context path cannot be retrieved without issuing a
servelt request, is it?
I too understand your point of hacking into server.xml. So, I am dropped
I am totally dependent on the context path to be able to initialize my
datastore library, there by having a fully qualified url in the
initialization phase. I guess, I have to change my code and build my url
whenever there is a request for getting data from the datastore.
There actually is a reason that the context path is not available in the
init() method of a servlet. Even though it is unusual, it's legal to have
the same servlet instances being processed in more than one webapp, and
therefore on more than one context path.
Therefore, if you need to do initialization based on the context path,
you're going to be stuck waiting for the first request. I've seen some
people in this situation modify their startup scripts to immediately send
some sort of "ping" request to their application to trigger this kind of
initialization, immediately after the server comes up, to ensure that the
first user doesn't have to wait.
To unsubscribe, e-mail: <mailto:tomc...@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomc...@jakarta.apache.org>