Glad you got it solved. Just be sure your String object is not null
before attempting to use the equals method. Otherwise, this call with
throw a NullPointerException. As in:
if ( ( sNode != null ) && ( sNode.equals( "0" ) ) {
// Do something here
}
I suggested using StringUtils.equals( String, String ) because it's done
automagically in the call.
--David
Christoph Bütler wrote:
> Thanks David
> Thanks Dominik
>
> Getting the string wasn't the problem. Now I have the solution:
>
> if (sNode.equals("0")) {
> out.print("somethinh");
> }
>
> The problem was the == operator. The == operator checks to see if two
> objects are EXACTLY the same object. Two strings may be different
> objects, but have the same value (have exactly the same characters in
> them).
>
> Cheers
> Christoph
>
> ----------------------------------------------------------------
> for list details see
> http://www.magnolia.info/en/magnolia/developer.html
> ----------------------------------------------------------------
--
=======================================
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture & Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: 607.255.9571
Fax: 607.255.0939
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------