You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Christoph Kukulies <ku...@gilberto.physik.rwth-aachen.de> on 2000/11/16 10:43:45 UTC

getRemoteHost() returns ""

I thought I could get the remote hostname in a Servlet
or jsp file. The following returns nothing for getRemoteHost():

<FORM>
HostIP="<%= request.getRemoteAddr() %>"
<INPUT TYPE='text'
           NAME='hn'
           VALUE="<%= request.getRemoteHost() %>"
           SIZE='15'>
</FORM>
</html>

I was suspecting it is a name resolution (DNS) problem but my
nameresolution sequence is hosts, then bind. And the host 192.168.1.119 
for example (it's an intranet) can be found.

Any clues?
-- 
Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de


Re: getRemoteHost() returns ""

Posted by Christoph Kukulies <ku...@gilberto.physik.RWTH-Aachen.DE>.
On Thu, Nov 16, 2000 at 10:39:03AM -0800, Craig R. McClanahan wrote:
> Christoph Kukulies wrote:
> 
> > I thought I could get the remote hostname in a Servlet
> > or jsp file. The following returns nothing for getRemoteHost():
> >
> > <FORM>
> > HostIP="<%= request.getRemoteAddr() %>"
> > <INPUT TYPE='text'
> >            NAME='hn'
> >            VALUE="<%= request.getRemoteHost() %>"
> >            SIZE='15'>
> > </FORM>
> > </html>
> >
> > I was suspecting it is a name resolution (DNS) problem but my
> > nameresolution sequence is hosts, then bind. And the host 192.168.1.119
> > for example (it's an intranet) can be found.
> >
> > Any clues?
> 
> What version of Tomcat are you trying this with?  It appears to work fine
> for me with 3.2b7 and 4.0m4, as long as DNS is correctly configured on the
> machine that Tomcat is running on.

I'm still using 3.1 beta. I just found that the Snoop servlet exposes the
same behaviour.
 
When I would upgrade to 3.2b7 (or what that is at the moment), what
differences would I have to expect? 

Could I migrate the webapps tree and tomcat-apache.conf seamlessly?

-- 
Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de

Re: getRemoteHost() returns ""

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Christoph Kukulies wrote:

> I thought I could get the remote hostname in a Servlet
> or jsp file. The following returns nothing for getRemoteHost():
>
> <FORM>
> HostIP="<%= request.getRemoteAddr() %>"
> <INPUT TYPE='text'
>            NAME='hn'
>            VALUE="<%= request.getRemoteHost() %>"
>            SIZE='15'>
> </FORM>
> </html>
>
> I was suspecting it is a name resolution (DNS) problem but my
> nameresolution sequence is hosts, then bind. And the host 192.168.1.119
> for example (it's an intranet) can be found.
>
> Any clues?

What version of Tomcat are you trying this with?  It appears to work fine
for me with 3.2b7 and 4.0m4, as long as DNS is correctly configured on the
machine that Tomcat is running on.

>
> --
> Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de

Craig McClanahan