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

    [...]
    rAddr.equals(....) ?

    [...]
     
    Joe Smith, Sep 8, 2003
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.