Custom JSP tag - detect existence of other instanc

2019-07-04 09:15发布

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.

1条回答
闹够了就滚
2楼-- · 2019-07-04 09:21

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

查看更多
登录 后发表回答