O'Reilly logo

J2EE™ Tutorial, The by Beth Stearns, Monica Pawlan, Eric Jendrock, Kim Haase, Dale Green, Stephanie Bodoff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How Is a Tag Handler Invoked?

The Tag interface defines the basic protocol between a tag handler and a JSP page’s servlet. It defines the life cycle and the methods to be invoked when the start and end tags are encountered.

The JSP page’s servlet invokes the setPageContext, setParent, and attribute setting methods before calling doStartTag. The JSP page’s servlet also guarantees that release will be invoked on the tag handler before the end of the page.

Here is a typical tag handler method invocation sequence:

ATag t = new ATag(); 
t.setPageContext(...); 
t.setParent(...); 
t.setAttribute1(value1); 
t.setAttribute2(value2); 
t.doStartTag(); 
t.doEndTag(); 
t.release(); 

The BodyTag interface extends Tag by defining additional methods that let a tag ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required