| From | Sent On | Attachments |
|---|---|---|
| Sridhar Devulkar | Dec 12, 2002 10:10 am | |
| Shapira, Yoav | Dec 12, 2002 10:56 am | |
| Sridhar Devulkar | Dec 12, 2002 11:31 am | |
| Craig R. McClanahan | Dec 12, 2002 7:33 pm |
| Subject: | RE: Accessing the Context tag attributes of server.xml ... | |
|---|---|---|
| From: | Craig R. McClanahan (crai...@apache.org) | |
| Date: | Dec 12, 2002 7:33:51 pm | |
| List: | org.apache.tomcat.users | |
On Thu, 12 Dec 2002, Sridhar Devulkar wrote:
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 ...
Hello Shapira,
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 this idea.
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.
Sridhar.
Craig





