In the code below, the second part (the else - which should display the "New
User"), never gets executed because it is located within the if block. It is
located within the brackets that denote the block of statements to be
carried out in the event that request.getParameter("usrName") is not null.
-----Original Message-----
From: Elamurugu Rajagopal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 27, 2000 9:09 AM
To: [EMAIL PROTECTED]
Subject: Re: out.println() stmt....
request.getParameter returns String, so try
request.getParameter("username").equals("");
I think this will do...
Gogia Nitin wrote:
> 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
===========================================================================
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