That can be elegantly handled with JSTL as

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

Sri

-----Original Message-----
From: teknokrat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2003 10:35 AM
To: [EMAIL PROTECTED]
Subject: Re: bean:write question


[EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to