When processing custom tags, We need to overload the doStartTag () and doEndTag () of the parent class. If the tag attribute is defined in the tld file, you need to define the corresponding setxxx/getxxx method for each attribute in tag handler.
In doStartTag (), the TemplateParameter object is obtained from the Hashtable defined by the Template class.
In doEndTag (),
PageContext. getRequest (). getRequestDispatcher (templateParam. getValue (). include (pageContext. getRequest (), pageContext. getResponse ());
This is the content generated by returning the resource object (RequestDispatcher) specified by the tag attribute value through the context of the jsp page ..
DoStartTag () and doEndTag () return values are static int defined in Tag Interface
SKIP_BODY implicit 0
Skip body evaluation. Valid return value for doStartTag and doAfterBody. Skip the processing of the body.
The code between the start and end labels is skipped.
EVAL_BODY_INCLUDE implicit 1
Evaluate body into existing out stream. Valid return value for doStartTag.
This is an illegal return value for doStartTag when the class implements BodyTag,
Since BodyTag implies the creation of a new BodyContent.
Output the body content to an existing output stream. Including jsp code or output
SKIP_PAGE implicit 5
Skip the rest of the page. Valid return value for doEndTag.
Ignore the remaining pages.
EVAL_PAGE implicit 6
Continue evaluating the page. Valid return value for doEndTag ().
Continue to execute the following page
There are references to other classes in this class, so I will not list them. You can study them by yourself.