You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Suzy Fynes <su...@sentenial.ie> on 2004/10/21 19:05:56 UTC

FW: property element in logic tag

 
Hi,
 
Can anyone see why the following will would not work
 
<logic-el:match name="PersonStatus"
property="person.countryCode.countryCode"
value="${CountryCode.countryCode}">
 
PersonStatus is a session object that contains a nested object
countryCode of type CountryCode and the class CountryCode contains a
string m_countryCode.
 
There is also a session object CountryCode that is an arraylist of
different country codes e.g. "UK" is United Kingdom, "IE" is Ireland etc
 
I tried using  <bean:write ="PersonStatus"
property="person.countryCode.countryCode"> and kept getting the error
Null property value for 'countryCode', but I've done system.out checks
and the object is set with values.
 
Thanks
Suzy

Re: FW: property element in logic tag

Posted by Jeff Beal <jb...@webmedx.com>.
I think you have a few extra layers of nesting.  What exactly are your 
system.out checks?  What's being called in  the custom tags is the same as

session.getAttribute("PersonStatus").getPerson().getCountryCode().getCountryCode()

The value portion of the <logic-el/> tag is

session.getAttribute("CountryCode").getCountryCode()

See if that's what you want to be called.  Based on your description, it 
seems like the "person." is irrelevant and the second 'countryCode' may 
need to be 'm_countryCode'

-- Jeff

Suzy Fynes wrote:
>  
> Hi,
>  
> Can anyone see why the following will would not work
>  
> <logic-el:match name="PersonStatus"
> property="person.countryCode.countryCode"
> value="${CountryCode.countryCode}">
>  
> PersonStatus is a session object that contains a nested object
> countryCode of type CountryCode and the class CountryCode contains a
> string m_countryCode.
>  
> There is also a session object CountryCode that is an arraylist of
> different country codes e.g. "UK" is United Kingdom, "IE" is Ireland etc
>  
> I tried using  <bean:write ="PersonStatus"
> property="person.countryCode.countryCode"> and kept getting the error
> Null property value for 'countryCode', but I've done system.out checks
> and the object is set with values.
>  
> Thanks
> Suzy
> 


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