This is also from API documentation javax.servlet.ServletRequest
java.lang.String getServerName()
Returns the host name of the server that received the request.
int getServerPort()
Returns the port number on which this request was received.
Denis
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology. [mailto:[EMAIL PROTECTED]]On
> Behalf Of Serdar BOZDAG
> Sent: Monday, July 22, 2002 1:49 PM
> To: [EMAIL PROTECTED]
> Subject: Re: can servlet know servers' ip?
>
>
> it gives the ip of the client not ip of the server.
> but i solved the problem by using relative path in the form.
> thanks,
> serdar
>
> ----- Original Message -----
> From: "Denis Kranjcec" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 22, 2002 2:14 PM
> Subject: Re: can servlet know servers' ip?
>
>
> > Hi
> >
> > What about API documentation javax.servlet.ServletRequest method
> > getRemoteAddr()
> >
> > This is from documentation:
> >
> > public java.lang.String getRemoteAddr()
> > Returns the Internet Protocol (IP)
> > address of the client that sent the request. For HTTP servlets, same as
> the
> > value of the CGI variable REMOTE_ADDR.
> > Returns:
> > a String containing the IP address of the client that sent the request
> >
> > RTFM :-)
> >
> > Denis
> >
> >
> > -----Original Message-----
> > From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API
> > Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Serdar
> BOZDAG
> > Sent: Monday, July 22, 2002 10:22 AM
> > To: [EMAIL PROTECTED]
> > Subject: can servlet know servers' ip?
> >
> >
> > hi,
> > i call a servlet at http://www.asdfg.com/servlet/helloWorld....
> >
> > this servlet need to know the ip of the server (http://www.asdfg.com)
> > because there is a form in the servlet and in action this
> servlet is used
> > again.
> > so i need
> > <FORM Action=" + ipOfTheServer + "/servlet/helloWorld">.
> > could you help pls?
> >
> > thanks in advance,
> > serdar
> >
> >
> __________________________________________________________________
> _________
> > 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
>
___________________________________________________________________________
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