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 a comment
10|10000 characters needed characters exceeded

Related questions

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 a 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 a 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.