commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nassim Chalfouh" <nassim.chalf...@prima-solutions.com>
Subject Evaluating null value in getValue?
Date Tue, 15 Jun 2004 09:16:58 GMT
Hi all,
i have the following classes:
public class Holder {

private String name;

private Holder sub;

Holder() {

name = "aaa";

sub = null;

}

public String getName() {

return name;

}

public Holder getSub() {

return sub;

}

}

and the sample code:
Holder h = new Holder();

JXPathContext jc = JXPathContext.newContext(h);

System.out.println((String) jc.getValue("name"));

System.out.println(jc.getValue("name='aaa'"));

System.out.println(jc.getValue("sub"));

System.out.println(jc.getValue("sub=null"));

The results are:
 
aaa

true

null

false         <---------- I expected true!

i tried to change the 

System.out.println(jc.getValue("sub='null'"));

but the output is still 'FALSE'

how can i test a null value in getValue method?

Thanks a lot for your help

Best regards,

 

 

 

_______________________________________________________________________ 

Nassim Chalfouh    |    Quality Assurance                     Direct
Line : +33 1 70 91 24 41 
PRIMA SOLUTIONS

Delivering the Unified Insurance Front-End
http://www.prima-solutions.com <http://www.prima-solutions.com/>

_______________________________________________________________________ 

This e-mail message is a private and confidential correspondence
intended only for use of the individual or entity 
named above. If you are not the intended recipient, or the agent
responsible to deliver it to the intended recipient, 
you are hereby notified that any dissemination, distribution or copying
of this communication is strictly prohibited. 
If you have received this communication in error, please immediately
notify us by return e-mail by clicking on the 
e-mail address shown at the bottom of this note or by  phone (+ 33 1 70
91 24 30), and delete it there after from
your system. Thank you. 

 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message