The algorythm below will check two strings for equality, but I think I need to use String.equals("value") to check if a string = a value, such as null. However, when I do that it throws a null point exception, becuase String is null.
 
Any ideas? 
 
John D. McDonald
CipherStream Systems
Phone: 925.373.8700
Fax:     413.793.6603
email: [EMAIL PROTECTED]
web: www.cipherstream.com
-------------------------------------------------------
Secure E-Business Is Our Business
-------------------------------------------------------
----- Original Message -----
From: Erik Sahl
Sent: Wednesday, January 05, 2000 3:37 PM
Subject: RE: Checking for null

You mean like...
 
String myValue = req.getParameter("value");
 
if (myValue != null)
{
    ...continue execution
}
 
                                                                                                       
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of John McDonald
Sent: Wednesday, January 05, 2000 4:03 PM
To: [EMAIL PROTECTED]
Subject: Checking for null

I am retrieving a value from a web page with req.getParameter("value"). How do I check if the string is null without getting a null pointer exception. Any ideas would be helpful.
 
 
John D. McDonald
CipherStream Systems
Phone: 925.373.8700
Fax:     413.793.6603
email: [EMAIL PROTECTED]
web: www.cipherstream.com
-------------------------------------------------------
Secure E-Business Is Our Business
-------------------------------------------------------

Reply via email to