tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brill Pappin" <brill.pap...@jmonkey.com>
Subject Re: Q: problem with authentication
Date Thu, 03 Feb 2000 11:02:40 GMT
>
> First the line if(...user=="") seems like a bug, you should code
user.equals("")
> instead.

It is the wrong way to do it... the == will test for equality of instance
(not content). In this case it might actually work, because two strings with
the same content are the same memory object... but this is only because the
Sun VM does it this way... in another VM, you *might* get a different
result.

it should be: if(user == null || user.length() == 0){

- Brill Pappin
  www.jmonkey.com



Mime
View raw message