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. Advertisements

  2. Jason

    Joe Smith Guest

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


    rAddr.equals(....) ?

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

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:
    1,137
    Chris Smith
    Sep 18, 2005
  2. Replies:
    3
    Views:
    568
    Roedy Green
    Jan 23, 2006
  3. Leif K-Brooks

    simple coding question

    Leif K-Brooks, Dec 31, 2003, in forum: HTML
    Replies:
    12
    Views:
    743
    Tina - AffordableHOST.com
    Jan 3, 2004
  4. Replies:
    0
    Views:
    4,938
  5. J Peterman

    Newbie needs help coding a simple shell

    J Peterman, Oct 9, 2003, in forum: C Programming
    Replies:
    2
    Views:
    358
    Richard Heathfield
    Oct 11, 2003
  6. Paul

    coding a simple calculator

    Paul, Mar 7, 2004, in forum: C Programming
    Replies:
    3
    Views:
    9,142
    Malcolm
    Mar 7, 2004
  7. calmar
    Replies:
    11
    Views:
    1,313
    calmar
    Feb 21, 2006
  8. Replies:
    5
    Views:
    693
Loading...