Hi,

Thanx Roy. Its really helpfull for me.

Hamid Hassan

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Roy Truelove
Sent: Sunday, April 08, 2001 2:14 AM
To: [EMAIL PROTECTED]
Subject: Re: Getting the IP of server


Hey Hamid..

    Try this :

InetAddress.getLocalHost().getHostAddress();

It returns the IP address of the machine running the code.

Later,
Roy

----- Original Message -----
From: "Hamid" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 07, 2001 5:49 AM
Subject: Re: Getting the IP of server


> Hi,
> Thanx , but none of both returns the servers IP.
> request.getRemoteHost() :  gives the IP of client machine from where the
> page is accessed  and
> request.getServerName() : gives the full server name like if u r using
> www.jsp.com/abc then it will return www.jsp.com not the IP address.
>
> Still waiting for response.
>
>
> Hamid Hassan
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of OK Prakasan
> Sent: Saturday, April 07, 2001 10:40 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Getting the IP of server
>
>
> Hi Hamid,
>      u can use request.getRemoteHost() and request.getServerName()
> to get the Server Name and Server IP
>
>
>
>
> Hamid <[EMAIL PROTECTED]>@java.sun.com> on 04/07/2001 10:33:33
> AM
>
> Please respond to A mailing list about Java Server Pages specification
>       and reference <[EMAIL PROTECTED]>
>
> Sent by:  A mailing list about Java Server Pages specification and
>       reference <[EMAIL PROTECTED]>
>
>
> To:   [EMAIL PROTECTED]
> cc:
> Subject:  Re: Getting the IP of server
>
>
> Hi,
> Can we get the IP of server from which the page is coming(Webserver).
> e.g
> If Webserver IP = 192.168.0.20 and its Name = www.JSP.com then how
> will we
> get its IP in jsp page.
>
>
> Hamid Hassan
>
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and
> reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Stefán F. Stefánsson
> Sent: Friday, April 06, 2001 4:38 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Getting the name of the server.
>
>
> wow... thanks for the tip... but I went with request.getServerName()
> :o)
>
> obviously I didn't look hard enough before asking :o( sorry about
> that.
>
> Regards, Stefan.
>
> p.s. one thing about the getServerName() though, it does exactly that,
> just the server name, not the scheme (http or https) or the port
> number
> (:XXX at the end of the server name.  Anyone have a remedy for that?
>
> -----Original Message-----
> From: Marie Josephe Plainecassagne [mailto:[EMAIL PROTECTED]]
> Sent: 6. apríl 2001 11:07
> To: [EMAIL PROTECTED]
> Subject: Re: Getting the name of the server.
>
>
> Try something like :
> <%
> StringBuffer sbu =
> javax.servlet.http.HttpUtils.getRequestURL(request);
> String uri = request.getRequestURI();
> String ssbu = sbu.toString();
> int indx = ssbu.indexOf(uri);
> ssbu = ssbu.substring(0,indx);
> %>
> getRequestURL() returns the full URL while getRequestUri()returns the
> relative URL.
>
> Marie-Jo
>
> ========================================================================
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
>
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
>
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to