RE: expression ALWAYS evaluates to if... NEVER to else

2002-10-18 Thread SMcGarrity
- From: Z.BEAT [mailto:zackbeatty;yahoo.com] Sent: Thursday, October 17, 2002 1:58 PM To: Tomcat Users List Subject: expression ALWAYS evaluates to if... NEVER to else In the following code snippet, the expression ALWAYS evaluates to the if statement block: String paramPassword = request.getParameter

RE: expression ALWAYS evaluates to if... NEVER to else

2002-10-18 Thread Turner, John
1:58 PM To: Tomcat Users List Subject: expression ALWAYS evaluates to if... NEVER to else In the following code snippet, the expression ALWAYS evaluates to the if statement block: String paramPassword = request.getParameter(paramPassword); String secretCode = secret; if(paramPassword

Re: expression ALWAYS evaluates to if... NEVER to else

2002-10-18 Thread Jacob Kjome
Hello Z.BEAT, If these are both java String objects then all you are comparing is if the memory location of string object #1 is the same as that of String object #2. This is probably not true. You need to compare like this. if (paramPassword.equals(secretCode)) { } else { } You can only

RE: expression ALWAYS evaluates to if... NEVER to else

2002-10-18 Thread Sexton, George
You need to learn how java compares objects and strings. The short story is: if(!paramPassword.equals(secretCode)) { } else { } -Original Message- From: Z.BEAT [mailto:zackbeatty;yahoo.com] Sent: 17 October, 2002 11:58 AM To: Tomcat Users List Subject: expression ALWAYS evaluates

RE: expression ALWAYS evaluates to if... NEVER to else

2002-10-18 Thread alan sparago
: expression ALWAYS evaluates to if... NEVER to else Hello Z.BEAT, If these are both java String objects then all you are comparing is if the memory location of string object #1 is the same as that of String object #2. This is probably not true. You need to compare like this. if (paramPassword.equals

RE: expression ALWAYS evaluates to if... NEVER to else

2002-10-18 Thread Z.BEAT
information on the equals and equalsIgnoreCase methods. Steve -Original Message- From: Z.BEAT [mailto:zackbeatty;yahoo.com] Sent: Thursday, October 17, 2002 1:58 PM To: Tomcat Users List Subject: expression ALWAYS evaluates to if... NEVER to else In the following code

expression ALWAYS evaluates to if... NEVER to else

2002-10-18 Thread Z.BEAT
In the following code snippet, the expression ALWAYS evaluates to the if statement block: String paramPassword = request.getParameter(paramPassword); String secretCode = secret; if(paramPassword != secretCode) { } else { } However, my debugging flags that I send in an HTML comment CLEARLY