simple jsp coding problem

Discussion in 'Java' started by Jason, Sep 8, 2003.

  1. Jason

    Jason Guest

    Hi,
    I am trying to check if the users is from a specific ip.
    However, it's not working as I planed. Would anyone tell me what I was
    doing wrong?
    Thanks a lot.

    <% String rAddr;
    rAddr=request.getRemoteAddr();
    out.println(rAddr + "<br>");
    if (rAddr=="192.168.0.1")
    { out.println(" 1 <br>");
    }
    else
    out.println("Not 1 <br>");
    %>
     
    Jason, Sep 8, 2003
    #1
    1. Advertising

  2. Jason

    Joe Smith Guest

    [...]
    > if (rAddr=="192.168.0.1")


    rAddr.equals(....) ?

    [...]
    > { out.println(" 1 <br>");
     
    Joe Smith, Sep 8, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    908
    Chris Smith
    Sep 18, 2005
  2. Leif K-Brooks

    simple coding question

    Leif K-Brooks, Dec 31, 2003, in forum: HTML
    Replies:
    12
    Views:
    589
    Tina - AffordableHOST.com
    Jan 3, 2004
  3. Replies:
    0
    Views:
    4,472
  4. calmar
    Replies:
    11
    Views:
    937
    calmar
    Feb 21, 2006
  5. Replies:
    5
    Views:
    487
Loading...

Share This Page