hope this should work,
<%
if(request.getParameter("usrName") != null)
        out.println(request.getParameter("usrName"));
else
        out.println("New User");
%>

naik

-----Original Message-----
From: Gogia Nitin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 27, 2000 11:48 AM
To: [EMAIL PROTECTED]
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

Reply via email to