commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert burrell donkin <robertburrelldon...@blueyonder.co.uk>
Subject Re: [Jelly] Accessing a HashMap in JellyContext variables from script
Date Fri, 26 Mar 2004 22:51:14 GMT
hi david

i'm not a JEXL expert but i'll give it a shot anyway...

my first suggestion is: try it! a failure is more likely to get a quick 
answer than a plea for general help.

if your idea doesn't work then i suspect that something like:

>> <j:if test="${myBeanMap.get("aBean").success}">

might work.

- robert

On 26 Mar 2004, at 19:57, David Wynter wrote:

> Hi,
>
> Is my question too hard or too stupid? I note from the Jexl code there 
> is an
> 'is' method for Boolean that it look sfor, not sure how this would 
> affect my
> approach to testing a Boolean, should I add an isSuccess() method to my
> bean?
>
> Thanks
>
> David
>
>> -----Original Message-----
>> From: David Wynter [mailto:david@roamware.co.uk]
>> Sent: 25 March 2004 15:32
>> To: Jakarta Commons Users List
>> Subject: [Jelly] Accessing a HashMap in JellyContext variables from
>> script
>>
>>
>> If I add a HashMap with JavaBeans in it into the JellyContext like so:
>>
>> 			HashMap myBeanMap = new HashMap();
>> 			MyBean aBean = new MyBean();
>> 			aBean.setSuccess(new Boolean(true));
>> 			myBeanMap.put("aBean", aBean);
>> 			JellyContext myContext = this.getContext();
>> 			myContext.setVariable("myBeanMap", myBeanMap);
>>
>> How would I then test that for that value in HashMap in a Jexl 
>> expression?
>>
>> something like this?
>> <j:if test="${myBeanMap.get("aBean").success == true}">
>> 	<pass/>
>> </j:if>
>>
>> Thanks
>>
>> David
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>


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


Mime
View raw message