You might pick one of the options:

1. Have some Init Params in web.xml to store the server name and port. 
Inside your contextInitialized() method, use

        ServletContextEvent.getServletContext().getInitParameter() 

to access them.

2. User Servlet Container Vendor APIs to extract the information.

Thanks and regards,
Pazhanikanthan. P (Paz)

Consultant for AXA,
Senior Software Engineer,
HCL Australia Services Pty. Ltd.
Off   : +61-3-9618-4085
Mob : +61-0411-354-838




"starki78" <[EMAIL PROTECTED]>
20/09/2006 05:52 PM
Please respond to "Struts Users Mailing List"
 
        To:     "user" <user@struts.apache.org>
        cc: 
        Subject:        Re: Getting the server-port from a ContextListener


HI!

No I want to write the server name and port 
where the applikation is running
in the
Database within the ContextInitialized Event!

Is this possible somehow?

Nice greetings


---------- Initial Header -----------

>From      : "Li" [EMAIL PROTECTED]
To          : "Struts Users Mailing List" user@struts.apache.org
Cc          : 
Date      : Wed, 20 Sep 2006 15:45:40 +0800
Subject : Re: Getting the server-port from a ContextListener







> r u trying to do some test case?
> 
> On 9/20/06, starki78 <[EMAIL PROTECTED]> wrote:
> >
> > HI!
> >
> > I've a Servlet implementing ServletContextListener
> > and in the contextInitialized I needed the server-name
> > and the port of the server.
> > So I needed to simulate a request.
> > Is this possible somehow?
> >
> > Thanks for any help!
> > Starki
> >
> >
> > ------------------------------------------------------
> > Tutti i libri che vuoi, li trovi su BOL. Ordini on line e paghi alla
> > consegna.
> > http://click.libero.it/bol
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> When we invent time, we invent death.
> 


------------------------------------------------------
Tutti i libri che vuoi, li trovi su BOL. Ordini on line e paghi alla 
consegna.
http://click.libero.it/bol



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_____________________________________________________________________ 
This e-mail has been scanned for viruses by MCI's Internet Managed 
Scanning Services - powered by MessageLabs. For further information 
visit http://www.mci.com



*********************************************************************************
Important Note
This email (including any attachments) contains information which is 
confidential and may be subject to legal privilege.  If you are not 
the intended recipient you must not use, distribute or copy this 
email.  If you have received this email in error please notify the 
sender immediately and delete this email. Any views expressed in this 
email are not necessarily the views of AXA.   Thank you.
**********************************************************************************

Reply via email to