Hello,
This is the situation:
I have an interface for people to enter various information. Then the details are passed on to a
servlet for further implementation. I want to give people an option not to fill in several fields.
So, in my servlet to start off:
String aString = req.getParameter("aName");
Then using the content of "aName" for another method:
aMethod(aString);
Problem: I implemented an if-statement so that if the user did not type in anything in "aName" then skip the method aMethod(). But I have tried:
if(aString != null)
{
aMethod(aString)
}
also
if(aString != "")
{
aMethod(aString)
}
Both of them didn't work, ie, it simply return true and the method was still being called. What is in that empty String when the Parameter didn't contain any value???
Please give me some suggestions!!!
Thanks so much!!!