commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nassim Chalfouh" <>
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"));




The results are:



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

i tried to change the 


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 

Delivering the Unified Insurance Front-End <>


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. 


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