commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dion Gillard <dion.gill...@gmail.com>
Subject Re: [Jelly] Define Beans
Date Fri, 13 Aug 2004 00:00:57 GMT
On Fri, 13 Aug 2004 00:39:35 +0200, Stefan Kleineikenscheidt
<stefan.tech@kleineikenscheidt.de> wrote:
> 
> Hello,
> 
> I would like to create a bean, which has a complex property.  My Jelly
> script looks something like that, but it doesn't work:
> 
> ---%<------------------------------------
> 
>   <define:taglib uri="mytaglib">
>     <define:jellybean
>       name="beanA"
>       className="package.name.BeanA"
>       method="execute" />
> 
>     <define:bean
>       name="beanB"
>       className="package.name.BeanB" />
>   </define:taglib>
> 
>   <goal name="hello">
> 
>     <mytaglib:beanB
>         var="mybeanb" />
> 
>     <mytaglib:beanA
>         var="myConverter"
>         propertyOfTypeBeanB="mybeanb" />  **)
>   ....
> 
> ---%<------------------------------------
> 
> **) Jelly tries to set 'mybeanb' as String to 'propertyOfTypeBeanB',
> which results in an IllegalArgumentException.

And so it should.

Defining a bean as part of a taglib means that it will call the
execute method when the tag is executing.

> Is there a way to do something like that with Jelly?
If you'd like to create a bean, and store it in a property, the
useBean tag http://jakarta.apache.org/commons/jelly/tags.html#core:useBean
is more appropriate.

-- 
http://www.multitask.com.au/people/dion/

---------------------------------------------------------------------
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