I found the most suitable solution for me.
Class javax.servlet.jsp.tagext.TagSupport
contains protected field pageContext
which presents... page context! I can easily access context attributes of javax.servlet.jsp.PageContext
. So, I put next code in my custom tag:
public int doStartTag() throws JspException {
if (pageContext.getAttribute("validated") == null) {
// validation code writing
pageContext.setAttribute("validated", true);
}
...
}
If condition would be reachable only once per page rendering.
Hope it would be useful for someone.