Hi David!
You've got the idea of jellys expression language (and also JSTL, if you
would use that) not right (some would say: RTFM ;) )! You can't call methods
in jelly and you don't have to!
Your script:
> <j:if test="${myBeanMap.get("aBean").success == true}">
> <pass/>
> </j:if>
would be:
<j:if test="${myBeanMap.aBean.success == true}">
<pass/>
</j:if>
or:
<j:if test="${myBeanMap['aBean'].success == true}">
<pass/>
</j:if>
And because your success field is a boolean (you have a is... method for
that, don't you?) you could do:
<j:if test="${myBeanMap.aBean.success}">
<pass/>
</j:if>
Greets,
Christian Beer
Projektleiter / Project Manager
diron GmbH & Co. KG
Daimlerweg 39-41
D-48163 Muenster, Germany
T +49-251-979 20 0
F +49-251-979 20 20
E [EMAIL PROTECTED]
WWW < http://www.diron.de/ >
----------------------------------------------------------
---- NEWS ---- NEWS ---- NEWS ---- NEWS ----
----------------------------------------------------------
Besuchen Sie uns auf der drupa 2004
D�sseldorf 06.-19.05. 2004
Dynamic Document Parc, Stand S11
----------------------------------------------------------
> -----Urspr�ngliche Nachricht-----
> Von: David Wynter [mailto:[EMAIL PROTECTED]
> Gesendet: Freitag, 26. M�rz 2004 20:58
> An: Jakarta Commons Users List
> Betreff: RE: [Jelly] Accessing a HashMap in JellyContext
> variables from script
>
>
> 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:[EMAIL PROTECTED]
> > 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: [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]