struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sri Sankaran" <Sri.Sanka...@sas.com>
Subject RE: bean:write question
Date Wed, 19 Mar 2003 15:41:03 GMT
That can be elegantly handled with JSTL as

<c:out value="${user.address.city}" default="help!"/>

Sri

-----Original Message-----
From: teknokrat [mailto:teknokrat@yahoo.com] 
Sent: Wednesday, March 19, 2003 10:35 AM
To: struts-user@jakarta.apache.org
Subject: Re: bean:write question


jul.g@freesbee.fr wrote:
>>hello
>>
>>>i have a class wich contains another class
>>>like class "user" which contains a class "adress" in a
> 
> response.
> 
>>>i'd like to write the properties in a jsp
>>> 
>>>
> 
> 
>><bean:write name="user" property="address.city" />
>>hth,
>>Tib
> 
> 
> 
> thanks
> couldn't have been more simple !
> -------------
> SPECIAL ADSL
> L'ADSL à partir de 15,95 EUR/mois et le modem ADSL offert ?  C'est en exclusivité chez
Tiscali !
> Pour profiter de cette offre, cliquez ici: http://register.tiscali.fr/adsl/
> Offre soumise à conditions.


Ok - but what happens if address is null - then you get NPE. Is there a 
way stop the NPE and have the field set to nothing i.e. empty

thanks



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


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


Mime
View raw message