----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

          Hi all,


    Sorry for disturbing the list but i have a problem and i cann't fix it.
In the archives no reference were  found.

My server config is:

    Redhat Linux 6.1
    Apache 1.3.9. + Apache Jserv1.1b3 compiled in source
    JSDK2.0
    IBM jdk118 for Linux

In a simple servlet I try to get the request.getRemoteHost() but it returns
an empty String.
In the httpd.conf file i set HostNameLookups on.
In the earlier (1.0) version of Jserv it worked great.

I thought that is is a configuration problem with my server config but
i ran the /cgi-bin/printenv script and  returned
....
REMOTE_HOST = gw.grafx.ro (this is correct).
....

I don't know what could be the problem.
Somebody said that it has to do with the IBM jdk but i tried on another
Linux box with
blackdown jdk 1.1.6 too with the same result.

Here is the source of my servlet:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;



public class HostNameServlet extends HttpServlet
{ 
public void init(ServletConfig conf) throws ServletException{
super.init(conf);
} 
public void doGet(HttpServletRequest req, HttpServletResponse res) throws 
ServletException, IOException 
{
res.setContentType("text/html");
PrintWriter toClient=res.getWriter();
toClient.println("Host:"+req.getRemoteHost()); 
toClient.println("<br>IP:"+req.getRemoteAddr()); 
toClient.close();
}
} 

 
Can somebody please try it?

Can somebody help me?

                    Thank You,
                                        Andras.




--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to