if (session.get("bla") == "test") {} // is always false wether it is "test" or not
if (session.get("bla") == null) {} // works if it is null
I’m not sure what the problem is but in my 1.2.2 installation I’m not able to compare
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Comparing objects with
==is comparing the objects’ references, which means that two strings with identical values might not be the same object. In order to compare the string values, useequals.I refer you to the Java documentation for String.