How about setting them as parameters to the servlet in your servlet engine's
config file (servlets.properties I think), then using 'String
getInitParameter(String parameterName)' to retrieve them from within the
init method?

Obviously, this means that you have to change the configuration if you move
the servlet to a different host/port, but it is accessible from within
init().

Stephen Baishya

----- Original Message -----
From: pascal jacob <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 11, 1999 6:54 PM
Subject: Re: How to get Host name and port number


>     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
>
>

___________________________________________________________________________
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

Reply via email to