jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Nielsen <gl...@voyager.apg.more.net>
Subject Re: Foundation taglib
Date Thu, 12 Apr 2001 13:41:02 GMT
Shawn Bayern wrote:
> 
> Glenn,
> 
> I've read over the Foundation library's code and am trying to form an
> opinion about how it fits into the larger picture.  Forgive me for trying
> to reduce it to a simple thought, but is it accurate to say that the
> Foundation taglib essentially brings to the table utility methods (and a
> statically stored "switching" mechanism between "info" objects storing
> data about accessor methods for classes) that parse Perl-like expressions
> in order to retrieve objects from various contexts?  (Long "single
> thought," huh?) :-)
> 
> It provides a number of other utilities as well (for headers, cookies, and
> the like), but I'm curious if that's an accurate description of your
> intended model.
> 

Yes, that is close.  Here is my expanded description in a nutshell.

For the JSP page author it provides a syntax for passing an object to
a JSP tag as an attribute.  The syntax supports references to a bean or 
script variable object and their properties, array/list elements, or hash members.

Beans or script variables must be well typed so that only those
properteries the taglib author wants to export to the JSP page are exposed.
This is done by supporting only the get/set methods for properties defined
in a BeanInfo with PropertyDescriptors.

Some tags in the foundation can support any type of object as long as it 
implements the required method.  For example the lessThan tag requires that
the compareTo() method be supported.  If the BeanInfo for the object
provides a MethodDescriptor for the compareTo() method, that object can
be used as an attribute for comparison in the lessThan tag.  Another example
is setting a property from a string, if an object supports the valueOf() method,
the set tag can set its value from a string.

Passing object data between JSP tags using this syntax provides a number
of benefits to the JSP page author and taglib developer.

1.  The JSP page author only needs to learn a simple syntax for referencing
    objects.  No scriptlets or rtexprvalues are needed.

2.  Fewer tags and attributes for tags need to be defined, so tag usage
    is much simpler and less verbose.

3.  Taglibs designed to be used with the foundation will require fewer
    tags and tag attributes, the taglib developer only needs to write
    a BeanInfo for any objects exported into the page.  Then the page
    author can use the core set of foundation tags to manipulate the 
    bean or script variable data.

4.  Methods are provided for the taglib developer so they can easily
    implement the same object syntax in the tags they design.

Here is a link to the foundation taglib docs for those who are interested:

http://jakarta.apache.org/cvsweb/index.cgi/~checkout~/jakarta-taglibs/foundation/doc/web/index.html?rev=1.1.1.1&content-type=text/html

Regards,

Glenn

----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Mime
View raw message