Thanks Ben,
I had an uneasy feeling I shouldn't be comparing Strings with != but couldn't put my finger on it. In view of what you say below:
Originally posted by Ben Souther:
This is also covered at the beginning of almost every book on Java that I've ever seen.
...it's clearly time to go back for the first time and review those early chapters...
Of course a String is not a primitive and I know I shouldn't compare two
objects with == ( unless I want to compare the references). I suppose a similar (or the the same) thing is happening here - I'm gonna give it some thought.
Thanks for reminding me about the possibility of a
null being returned - I came across it in earlier experiments when names in HTML and Servlet didn't match. I'll build the check in.
But what about checking a String for non-empty with length()?
Does this get the stamp of approval?
[ February 17, 2008: Message edited by: Dick Summerfield ]