Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > simple jsp coding problem

Reply
Thread Tools

simple jsp coding problem

 
 
Jason
Guest
Posts: n/a
 
      09-08-2003
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>");
%>


 
Reply With Quote
 
 
 
 
Joe Smith
Guest
Posts: n/a
 
      09-08-2003
[...]
> if (rAddr=="192.168.0.1")


rAddr.equals(....) ?

[...]
> { out.println(" 1 <br>");



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
data, jsp and jsp tag problem, best practice needed quickcur@yahoo.com Java 5 10-05-2006 04:19 AM
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
general coding issues - coding style... calmar Python 11 02-21-2006 10:36 AM
Hard coding HTML into JSP tag handler todd.huss@gmail.com Java 5 09-18-2005 10:26 PM
simple coding question Leif K-Brooks HTML 12 01-03-2004 11:26 AM



Advertisments