views:

78

answers:

1

Is it possible for a custom JSP tag to detect if there are other instances of itself within a page? If so, what's the preferred way to do this? My tag's output needs to be conditional dependent upon whether it's the only instance or not.

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

+3  A: 

You could make use of the PageContext#setAttribute() and getAttribute().

BalusC