John,
One way is to enumerate through the parameter keys and get the
values like as below.
import java.uitl.*;
....
Enumeration keys = req.getParameterNames();
while ( keys.hasMoreElements() )
{
String key = (String)keys.nextElement();
String value = (String)req.getParameter(key);
......
......
}
hope this helps.
Thanks,
NJ.
>MIME-Version: 1.0
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Mimeole: Produced By Microsoft MimeOLE V5.00.2314.1300
>Date: Wed, 24 Nov 1999 13:35:52 -0800
>From: John McDonald <[EMAIL PROTECTED]>
>Subject: getParameter() != null
>To: [EMAIL PROTECTED]
>
>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
>
>John D. McDonald
>CipherStream Systems
>email: [EMAIL PROTECTED]
>web: www.cipherstream.com
>-------------------------------------------------------
>Secure E-Business Is Our Business
>-------------------------------------------------------
--------------------------------------------------------------------------------
/\ Nalini Johnas
\\ \ E-mail: [EMAIL PROTECTED]
\ \\ / Ext : x38008
/ \/ / /
/ / \//\
\//\ / /
/ / /\ / (I prefer SUN workstations...)
/ \\ \
\ \\
\/
___________________________________________________________________________
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