JSP Custom Tag - Detects other instances

Is it possible for a custom JSP tag to detect if there are other instances of itself inside the page? If so, what is the preferred way to do this? The output of my tag must be conditional, depending on whether it is a single instance or not.

Please note that my page has three occurrences of my tag, two of which have a different set of attributes from the third, so I know that there are two separate tag instances allocated from the resource pool.

+3
source share
1 answer

You can use PageContext#setAttribute()and getAttribute().

+3
source

Source: https://habr.com/ru/post/1723760/


All Articles