What about:
import java.net.*;
InetAddress theIPaddress = null;
try {
theIPaddress = InetAddress.getLocalHost();
theIPaddress.getHostName();
}
catch (UnknownHostException e) {
pascal jacob wrote:
> I'm interrested in the host name and port number used by the servlet
> engine that initialize me; and at init() time please, not when doGet() or
> doPost() is called (it will be to late for me).
>
> ZartC++
>
> > Who's host name and port number are you trying to retrieve at init() time?
> > Some servlet runners are capable of running on a seperate machine from the
> > web server or web servers that they are processing requests for.
> >
> > John Zerbe - Mellon Bank
> > Phone: 412-234-1048 E-Mail: [EMAIL PROTECTED]
> >
> >
> >
> >> -----Original Message-----
> >> From: pascal jacob [SMTP:[EMAIL PROTECTED]]
> >> Sent: Friday, June 11, 1999 9:58 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: How to get Host name and port number
> >>
> >> My problem is to get the host name and the port number at init() time -
> >> i.e.
> >> we don't have a ServletRequest yet !
> >>
> >> ZartC++
> >>
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
"Some will tell you that an organization is the people who make it up, but
that's not the case at all.
The whole is larger and completely different from the sum of its parts. [...]
The underlying theory is
that you motivate people to provide value to society by making it be in their
best interest to do so."
Jamie Zawinski
begin:vcard
n:Baumg�rtner;Christof
tel;cell:+49 171 8169911
tel;fax:+49 89 66654199
tel;work:+49 89 66654100
x-mozilla-html:TRUE
url:www.websentric.com
org:WebSentric Software GmbH
adr:;;Keltenring 11;Oberhaching;;82041;Germany
version:2.1
email;internet:[EMAIL PROTECTED]
x-mozilla-cpt:;24336
fn:Christof Baumg�rtner
end:vcard
S/MIME Cryptographic Signature