struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Siggelkow <bills...@bellsouth.net>
Subject Re: <bean:write> and get...()
Date Fri, 04 Jun 2004 13:50:58 GMT
The reason you "System.out.print(foo.getBar())" printed "null" is 
because that is how the print method is written. If the returned value 
of the method is actually <code>null</code> then the "print" method 
prints the value "null".

Long story short, what you are seeing is result of calling 
"System.out.print" not the result of the returned property value.

Kapisch(sic?)?

Marcelo Epstein wrote:

> Hi,
> 
> When I use <bean:write ...> if the value is null, the tag returns "".
> But, when I try, for example, System.out.print(xxx.getProperty()) inside an Action and
the property is null. It returns the String "null". 
> What is the best practice to avoid printing "null" ? I have to check all values before
printing? Is there a better way to do that?
> 
> Thanks in advance,
> Marcelo


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message