You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Miao, Franco CAWS:EX" <Fr...@gems7.gov.bc.ca> on 2001/10/25 22:21:23 UTC

getRemoteAddr() vs getRemoteHost()

 When I put the following code in my Jsp, it comes up two identical
remote IP addresses, instead of one remote IP and one remote host name. My
computer  has Internet IP and valid Internet DNS server. Any suggestion
about
that?


Thanks!

out.print( request.getRemoteAddr() );
out.print( request.getRemoteHost() );

Franco


Re: getRemoteAddr() vs getRemoteHost()

Posted by Yoav Shapira <sh...@mpi.com>.
Hi,
My guess is you need to enable remote address lookups in your 
server.xml.  Since they are expensive to log, they are usually turned
off by default, and the behavior is to simply return the address
rather than the host.

Yoav

"Miao, Franco CAWS:EX" wrote:
> 
>  When I put the following code in my Jsp, it comes up two identical
> remote IP addresses, instead of one remote IP and one remote host name. My
> computer  has Internet IP and valid Internet DNS server. Any suggestion
> about
> that?
> 
> Thanks!
> 
> out.print( request.getRemoteAddr() );
> out.print( request.getRemoteHost() );
> 
> Franco