Thanx a lot for the help.
As suggested, I used 'if (request.getParameter("val") != null &&
request.getParameter("val").equals("1"))' and it works beautifully. Wonder
what else here(JSP/Java)  is very different from the other programming
languages!?!

----- 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") == "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.getParameter("val").equals("1"))
> {
> ...
> }
>
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to