You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Bob Lee <bo...@dynwebdev.com> on 2001/12/03 00:15:34 UTC

Tag Getters

Are getter methods mandatory on Tag impls? When are they used?

Thanks,
Bob

Re: Tag Getters

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Sun, 2 Dec 2001, Igor Fedulov wrote:

> Date: Sun, 2 Dec 2001 17:28:03 -0600 (CST)
> From: Igor Fedulov <if...@outlook.net>
> Reply-To: Tag Libraries Developers List <ta...@jakarta.apache.org>
> To: Tag Libraries Developers List <ta...@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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tag Getters

Posted by Igor Fedulov <if...@outlook.net>.
> 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 :)

Best regards,
--
HTTP is a stateless protocol, and the Internet is a stateless development
environment
--
Igor Fedulov
E-mail : ifedulov@outlook.net
Work Ph: 773.775.1595
Home Ph: 773.281.8938
Cell Ph: 773.580.5935




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>