After checking for the null also do a check for the empty string as well..
Have a nice day.
With regards,
Sachin S. Khanna.
www.emailanorder.com
----- Original Message -----
From: Gogia Nitin <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 27, 2000 3:47 PM
Subject: out.println() stmt....
> Can anyone tell me what's wrong with the code. I want to get the user name
> from the FORM and display it on the screen. If the user name entered on
the
> FORM is null i want to enter "New User".
> Now the problem is with 2nd part i.e. when User Name is null. "New User"
is
> not being displayed on the screen and the JSP engine
> compiles the code correctly. So where exactly the problem lies ?
>
> <%if(request.getParameter("usrName") != null)
> {
> out.println(request.getParameter("usrName"));
> else
> out.println("New User");
> }%>
>
>
> Thanks in advance,
> Nitin
>
>
===========================================================================
> 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
>
===========================================================================
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