|
Tag (Servlet and JavaServer Pages API Documentation)
javax.servlet.jsp.tagext
|
Field Summary | |
static int |
EVAL_BODY_INCLUDE
Evaluate body into existing out stream. |
static int |
EVAL_PAGE
Continue evaluating the page. |
static int |
SKIP_BODY
Skip body evaluation. |
static int |
SKIP_PAGE
Skip the rest of the page. |
Method Summary | |
int |
doEndTag()
Process the end tag for this instance. |
int |
doStartTag()
Process the start tag for this instance. |
Tag |
getParent()
Get the parent (closest enclosing tag handler) for this tag handler. |
void |
release()
Called on a Tag handler to release state. |
void |
setPageContext(PageContext pc)
Set the current page context. |
void |
setParent(Tag t)
Set the parent (closest enclosing tag handler) of this tag handler. |
Field Detail |
public static final int SKIP_BODY
public static final int EVAL_BODY_INCLUDE
public static final int SKIP_PAGE
public static final int EVAL_PAGE
Method Detail |
public void setPageContext(PageContext pc)
This value is *not* reset by doEndTag() and must be explicitly reset by a page implementation if it changes between calls to doStartTag().
pc
- The page context for this tag handler.public void setParent(Tag t)
This value is *not* reset by doEndTag() and must be explicitly reset by a page implementation.
t
- The parent tag, or null.public Tag getParent()
The getParent() method can be used to navigate the nested tag handler structure at runtime for cooperation among custom actions; for example, the findAncestorWithClass() method in TagSupport provides a convenient way of doing this.
The current version of the specification only provides one formal way of indicating the observable type of a tag handler: its tag handler implementation class, described in the tag-class subelement of the tag element. This is extended in an informal manner by allowing the tag library author to indicate in the description subelement an observable type. The type should be a subtype of the tag handler implementation class or void. This addititional constraint can be exploited by a specialized container that knows about that specific tag library, as in the case of the JSP standard tag library.
public int doStartTag() throws JspException
The doStartTag method assumes that the properties pageContext and parent have been set. It also assumes that any properties exposed as attributes have been set too. When this method is invoked, the body has not yet been evaluated.
This method returns Tag.EVAL_BODY_INCLUDE or BodyTag.EVAL_BODY_BUFFERED to indicate that the body of the action should be evaluated or SKIP_BODY to indicate otherwise.
When a Tag returns EVAL_BODY_INCLUDE the result of evaluating the body (if any) is included into the current "out" JspWriter as it happens and then doEndTag() is invoked.
BodyTag.EVAL_BODY_BUFFERED is only valid if the tag handler implements BodyTag.
The JSP container will resynchronize any variable values that are indicated as so in TagExtraInfo after the invocation of doStartTag().
JspException.
JspException
BodyTag
public int doEndTag() throws JspException
This method will be called after returning from doStartTag. The body of the action may or not have been evaluated, depending on the return value of doStartTag.
If this method returns EVAL_PAGE, the rest of the page continues to be evaluated. If this method returns SKIP_PAGE, the rest of the page is not evaluated and the request is completed. If this request was forwarded or included from another page (or Servlet), only the current page evaluation is completed.
The JSP container will resynchronize any variable values that are indicated as so in TagExtraInfo after the invocation of doEndTag().
JspException.
JspException
public void release()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |