Skip to Content
author's profile photo Former Member
Former Member

IP address of client

Does anybody know how to obtain the IP address of the client in my iView?

I tried <b>request.getServletRequest().getRemoteAddr()</b>, but for some reason it returns the IP address of the portal server instead of the IP address of the client.

I have tried both with "Bypass iView server", and without, in the iView setup.

Any help will be appreciated.

Thanks,

Atul

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Posted on Feb 24, 2004 at 12:14 PM

    First:

    getServletRequest

    public javax.servlet.http.HttpServletRequest getServletRequest()Gets the actual servlet request. Note: It is recommended not to access the servlet request if possible. This is only available, if the request was initiated from a servlet based connection.

    Returns:

    The actual servlet request or null if not applicable

    there you have 3 methdos:

    String getRemoteAddr()

    Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.

    String getRemoteHost()

    Returns the fully qualified name of the client or the last proxy that sent the request.

    int getRemotePort()

    Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request

    BR,

    Oliver

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Oliver,

      Thanks for taking the time to reply. If you look at the original message, I have tried exactly what you said I should do. However, The address returned is that of the portal server, instead of the client.

      I think I will open an OSS message - I will update here on how that goes.

      Thanks,

      Atul

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2004 at 10:13 AM

    Just tried it from two different clients, and it correctly returns the ip of the client.

    Don't know whats going wrong.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Oliver Stiefbold

      Oliver,

      Thanks for the response. We use EP5, and I do have the iView setting at "Bypass iView server".

      I think this is heading in the right direction, except that I do not know what classes you are referring to. Can you tell me which class has the getAllProperties[] method?

      Also, I checked the javadoc for the PortalRuntime object, and none of the four methods seemed to be appropriate. If you could provide just a little more info, that would help me a lot.

      Thanks,

      Atul