jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Tag Getters
Date Sun, 02 Dec 2001 23:42:43 GMT


On Sun, 2 Dec 2001, Igor Fedulov wrote:

> Date: Sun, 2 Dec 2001 17:28:03 -0600 (CST)
> From: Igor Fedulov <ifedulov@outlook.net>
> Reply-To: Tag Libraries Developers List <taglibs-dev@jakarta.apache.org>
> To: Tag Libraries Developers List <taglibs-dev@jakarta.apache.org>
> Subject: Re: Tag Getters
>
>
> > Are getter methods mandatory on Tag impls? When are they used?
>
> Getters allow you to encapsulate the property which value is being
> retreived, i.e. when you subclassing BodyTagSupport for example it comes
> with support for "id" property, so you can just getId() to retreive it's
> value, so the same way if somebody is going to subclass your
> tag handler they should have access to getFoo() instead of accessing 'foo'
> field directly...
>
> I hope this is the correct explanation, if not please correct me :)
>

Subclassing is certainly one common use case.  Another is when you use
nested tags, and need to access configuration properties set in the
"outer" tag from an "inner" tag.

The JSP container itself does not use the getters, however.

Craig McClanahan


--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message