commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Sell <>
Subject Re: [jelly] taglib implementation questions
Date Tue, 21 Jan 2003 14:21:14 GMT
attached are the patch files, along with one new file.

What I have done is

1. added lookup for addXX method in BeanPropertyTag, so that the 
parameter class is used as the nested element class if no createXX 
method is present

2.some cleanup and fixes. I have enabled the beandef tag (className 
property), and used it in the testcases instead of the statically 
defined customer tag.

3. added and modified testcases. I have changed the test taglib to not 
inherit from BeanTagLibrary any more. The Order class now has an 
addProduct instead of a createProduct, to test the new method lookup. 
Added one test case for nesting inside arbitrary tags

BTW, the nesting inside arbitrary (BeanSource) tags was basically 
working before all this ;-). All I have done is remove the requirement 
for the createXX method. Of course, the lookup for the addXX methods is 
somewhat expensive..

I hope you find this useful

James Strachan wrote:
> From: "Christian Sell" <>
>>James Strachan wrote:
>>>Agreed. It should be pretty easy to do - fancy having a go? The existing
>>>BeanTag and BeanPropertyTag do almost all you need - we'd just need the
>>>BeanPropertyTag to be able to optionally support addFoo(Foo) methods by
>>>invoking the no-arg constructor of Foo - right now it just uses the
>>>createFoo() pattern.
>>I have already started to do it. In what format do you want the changes?
> Excellent! :-)
> A patch would be great...
> e.g.
> cvs diff -u >> patchfile.txt
> BTW (and forgive me if this is obious) if BeanTag and/or BeanPropertyTag are
> patched to do what you need, then you'll be able to just reuse these classes
> as is in your own TagLibrary without the need for inheritence which was one
> of your early concerns. i.e. its a clean reuse
> James
> -------
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

View raw message