Hi!
I'm new to JSP. I have a JSP file which must perform a task depending on
the value passed through a query-string in the url. But I am not able to
make the comparison;i.e,
if my url is : 'first.jsp?val=1'
and in the jsp file, I check the value of the string passed as shown below:
if (request.getParameter("val") == "1")
{
---------
}
This condition is not true though my query string is 'val=1', which I
understand is a string and the above compare should work fine.
My guess was that probably the query string includes a terminator or
something similar which is not in the hard-coded value("1"), but on checking
the length after assigning both to string variables, the lengths were the
same. Please note that the comparison of these string variables too gave me
a negative result.
Please help.
===========================================================================
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