-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Rony,

On 9/11/20 10:28, Rony G. Flatscher (Apache) wrote:
> While exploring, experimenting with creating a taglib (implementing
> the BodyTag interface) I would have a need to find out the tag name
> that caused the tagclass to run.
>
> Is this possible? If so, how would one be able to get at that tag
> name (any brief hints would suffice) ?
>
> ---rony
>
> P.S.: If possible I would like to write a single tagclass, but use
> it for two or more different tags, as the implementation would
> share quite a lot of code. Besides, it might be helpful for
> debugging.

It seems like this is the wrong approach, unless you just want to use
this for something like logging.

I you want the tags to behave differently, then you should have
separate tag implementations. Feel free to build a base class with the
shared code and then implement the differences in subclasses.

It's been a loooong time since I wrote a custom tag library but I do
remember that the whole process was very painful and despite the
flexibility allowed by the API, lots of common things (like getting
the tag name!) were either awkward or impossible.

IMO, the JSP effort was a stepping-stone on a path to better
technologies like Velocity, FreeMarker, and others. If I were king,
JSP would just go away. Just my POV of course, you are welcome to fall
in love with JSP. :)

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl9btG8ACgkQHPApP6U8
pFiYyhAAxG/8tTbGEp9pN3RvxjvRQXf+UupG4S3CXQNoNeVr4ffpWWii0kLHLLpj
YoBpqNUjsl4Uki2jLADPioUHKdLOmVSlL6NTEcgMyEdIrCsI1A49okpnAIIX5EVB
SRbfiUnv+37zQrKn3HbNnW8p6OoANHaEpGyfP6ylv6nj85nm9eAmXeKy/BcQLrI3
qRPD4migbvxGSU5M36YbT74q4azYV0bXEDh/9M3+Ky6iuPGGe0H+Y6V/JoERQt6d
X3+QFxNWPxWW/BEoWkNjKfLHJgbYWQC5mgk7kK3u82DUV6fqGE95tiimhmSQwz8t
qfeS/nDVVCh2c2hARneHriD8LV7ve62gjfY0y6BfXJG8Jl0vg6kokgdGu9hABLDG
bj/BYjznC8qipN2I/X7Rn5eEr7RzxmMN3WigOFjsh4fUWNzcT6EP2CIphnmifPFx
gIwj7SPuWmB8itN2MV4EouF+MkEB9LSPQGeDxYn+hTnfucbVjlH9QVJ5vQDGyGkr
ZbmMB7HdriDj1CRWO22y2sxGHkKjRTb/uzkfy0XDNCJpw1SswaVcm9lep+aVq1zc
ocKGS8PTbFiSKGLHt+ythKqTcwWhFjStXgGxPVntw/aBzlfIfIUlA8bsteWAH6Ic
Go27fA6u0bBp+afq6gYbkTtGSY/leaFi1xfwX0G5uAT/AAVdObc=
=2h8G
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to