On Wed, 24 Nov 1999, John McDonald wrote:
> Can anyone please tell me how I look for a null value
> parameter. What I have is an if loop that iterates through the
> unknown quantity of parameters(I've assinged numbers as the names of
> the parameters). I want to be able to tell the loop to break when
> I've come to a null parameter value(hence the last parameter). I am
> able to get the value, from the parameter, back as null but for some
> reason I can't write a boolean that will return true. I've tried ALL
> of the following:
>
> if(req.getParameter(nameOfParam) != null)
> if(req.getParameter(nameOfParam) != (null))
> if(req.getParameter(nameOfParam) != ("null"))
> if(!(req.getParameter(nameOfParam) == null))
>
> String temp = req.getParameter(nameOfParam);
> if(temp != null)
> if(temp != (null))
> if(temp != ("null"))
> if(!(temp == null))
>
> NONE of these return true. What the HECK am I doing wrong?
>
> I'd apprecate any help. Thanks
If I'm understanding you right, you can just use getParameterValues()
and avoid all the hassle.
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
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