I hope you read my and Kevin's replies. You should always check for null on
target variables for getParameter() method before calling any method on
them. Otherwise you will get NullPointerException if the parameter is
optional and not selected on the form or not supplied in the query string.
Use
if (name != null && name.trim().length() > 0)
{ do_something;}
else
{ do_something_else;}
Vivek
> -----Original Message-----
> From: Sanika Kapoor [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 16, 2000 4:47 PM
> To: [EMAIL PROTECTED]
> Subject: Re: getParameter method return null string
>
>
> You can also check like this :
>
> String Name = request.getParameter("Name");
> if(!Name.equals(""))
> {
> do something
> }
> else
> {
> System.out.print(Name is returning null);
> }
>
> Sanika.
>
>
> ______________________________________________________________
> __________
> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html