whether their values are equivalent. thats a powerful piece of
flexibility--one that you have elsewhere as well..
bradley mclain
>From: Divya M A <[EMAIL PROTECTED]>
>Reply-To: Divya M A <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Using query string values in JSP
ginal Message -
> From: Mike McKechnie <[EMAIL PROTECTED]>
> To: Divya M A <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, March 27, 2000 4:55 PM
> Subject: Re: Using query string values in JSP
>
>
> > > if (request.getParameter("
ages!?!
- Original Message -
From: Mike McKechnie <[EMAIL PROTECTED]>
To: Divya M A <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, March 27, 2000 4:55 PM
Subject: Re: Using query string values in JSP
> > if (request.getParameter("val") == "
i think that since you are comparing strings you need to use the method
String.equals() for the comparison.
e.g. if(request.getParameter("val").equals("1"){...
bradley mclain
>From: Divya M A <[EMAIL PROTECTED]>
>Reply-To: Divya M A <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Using que
Divya,
You were probably a C++ programmer in a past life like myself. I made this
mistake myself when I first went from C++ to Java. The operator overloading
for string comparisons that you can rely on in C++ to compare two strings by
value doesn't work in Java. Java doesn't support operator over
> if (request.getParameter("val") == "1")
In Java, the '==' operator does an identity comparison -- that is, two
object references are equal only if they refer to the same object.
To lexically compare two strings, do something like:
if (request.getParameter("val") != null &&
request.getParamet