Harris,
If you don't get a maintenance-free method from the group, you can always do the
following:
In the servlet:
public void init() throws ServletException {
String lConnectTNSName = getServletContext().getInitParameter("ConnectTNSName");
if(lConnectTNSName == null)
throw new RuntimeException("ConnectTNSName is null");
...
In the web applications web.xml I store the site-specific info:
<web-app>
<display-name>**** (display-name)</display-name>
<description>*** servlets and JSP pages.</description>
<context-param>
<param-name>ConnectTNSName</param-name>
<param-value>xxxx</param-value>
</context-param>
...
You could store any info you want this way and it only needs to be re-entered when a
change to your web.xml is required.
Hope the group gives you a better answer, but this is handy for a variety of things.
Chuck
-----Original Message-----
From: Harris Reynolds [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 12:29 PM
To: '[EMAIL PROTECTED]'
Subject: Server URL Before Request
Is there a mgmt API that will allow me to get the URL that the server is
running on from within the servlet init method (i.e. *before* the first
request comes in)? ...really all I would need is the port number (the
hostname and context paths would be easy enough to get).
thanks for any tips,
~harris
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]