You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jose Francisco Junior <jj...@zipmail.com> on 2002/08/09 20:55:02 UTC

Converting HOST to IP an IP to HOST

All right, but it does not solve my problem. I did a local
 web system that can be accessed both by IP or HOST.
 Depending on the way the user accessed( by HOST or IP )
 the application I must display different contents. 

I could do this:

if(
 request.getRequestURL().toString().equals("192.168.20.10")
 ) 
 out.print("show IP content"); 
else 
 ou.print("show HOST content");

But the web server has many network devices and the user
 can accesss the system from many other IP and HOSTs.

The InetAddress.getByName() does not work with the machine
 network name only with inet hosts.

Does anybody has any idea ???


Thanks in advice,
Junior



On Fri, 9 Aug 2002 13:50:59 -0400 
"Turner, John" <JT...@AAS.com> wrote:
>
>Come on...RTFM:
>
>java.net.InetAddress.getByName();
>
>Sheesh.
>
>John Turner
>jturner@NOSPAM.aas.com
>
>
>-----Original Message-----
>From: Jose Francisco Junior [mailto:jjunior@zipmail.com]
>Sent: Friday, August 09, 2002 1:44 PM
>To: Tomcat Users List
>Subject: Re: Configuration for High TPS
>
>
>Please,
>
>I know it is a bit off-topic but I am trying to get a IP
> address from an URL like this:
>new URL("http://java.sun.com"); //this is the URL
>
>How can I get the IP address from this URL? Any idea ??
>
>
>Thanks in advance,
>Junior 
>________________________________________________
>Don't E-Mail, ZipMail! http://www.zipmail.com/
>
>--
>To unsubscribe, e-mail:
><ma...@jakarta.apache.org>
>For additional commands, e-mail:
><ma...@jakarta.apache.org>
>
>--
>To unsubscribe, e-mail:
>   <ma...@jakarta.apache.org>
>For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>

-----------------------------------------
Prefiro as lágrimas da derrota
do que a vergonha de não ter lutado... 

Willan Brook
-----------------------------------------
________________________________________________
Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>