commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Sell <christian.s...@netcologne.de>
Subject Re: [jelly] taglib implementation questions
Date Mon, 20 Jan 2003 17:44:01 GMT
BTW, the BeanTagLibrary seems to also require that objects implement 
createXX methods for nested elements. Why cant the object type simply be 
inferred from the argument of the setXX method, and the object be 
created by the default constructor? I think that is what Ant does.

thanks,
Christian

James Strachan wrote:
> From: "Christian Sell" <christian.sell@netcologne.de>
> 
>>Hi,
>>
>>is there a way to do this:
>>
>><mytag class="myClass">
>>   <someTag someAtt="dada>
>>     <anotherNestedElement att="dada"/>
>>   </someTag>
>></mytag>
>>
>>where <mytag> comes from a library which is not derived from
>>BeanTagLibrary or any other Library, and the other tags are not defined
>>in any library.
>>
>>The result should be that from the nested tags an object hierarchy is
>>created, and the root object supplied to the mytag object through the
>>setSomeTag() method.
> 
> 
> Right now if you created your own library, deriving from BeanTagLibrary and
> registered "mytag" as a possible root tag, it'd all just work. However you
> did say...
> 
> 
>>where <mytag> comes from a library which is not derived from
>>BeanTagLibrary or any other Library
> 
> 
> why do you have this restriction? Is it namespaces that you don't want to
> expose to the end user? You can always register that the empty namespace
> binds to your tag library and it'd just work.
> 
> e.g.
> 
> public class MyTagLibrary extends BeanTagLibrary {
>     public MyTagLibrary() {
>         registerBean( "mytag", MyDefaultBean.class );
>     }
> }
> ...
> 
> JellyContext context = new JellyContext();
> context.registerTagLibrary( "", new MyTagLibrary() );
> context.runScript( "my.jelly" );
> 
> then the script that you supplied would just work.
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-user-help@jakarta.apache.org>
> 
> 



Mime
View raw message