| Section 12 |
|---|
12.1 Identify the tag library descriptor element names that declare the following:
|
12.2 Identify the tag library descriptor element names that declare the following:
|
12.3 Given a custom tag, identify the necessary value for the bodycontent TLD element for any of the following tag types:
|
| 12.4 Given a tag event method (doStartTag, doAfterBody, and doEndTag), identify the correct description of the methods trigger. |
12.5 Identify valid return values for the following methods:
|
12.6 Given a "BODY" or "PAGE" constant, identify a correct description of the constant's use in the following methods:
|
12.7 Identify the method in the custom tag handler that accesses:
|
| 12.8 Identify methods that return an outer tag handler from within an inner tag handler. |
12.1 Identify the tag library descriptor element names that declare the following:
<attribute> <name>username</name> <rtexprvalue>true</rtexprvalue> <required>false</required> <type>String</type> </attribute> <!ELEMENT taglib (tlib-version, jsp-version, short-name, uri?, display-name?, small-icon?, large-icon?, description?, validator?, listener*, tag+) > <!ELEMENT tag (name, tag-class, tei-class?, body-content?, display-name?, small-icon?, large-icon?, description?, variable*, attribute*, example?) > <!ELEMENT variable ( (name-given | name-from-attribute), variable-class?, declare?, scope?, description?) > <!ELEMENT attribute (name, required? , rtexprvalue?, type?, description?) >
12.2 Identify the tag library descriptor element names that declare the following:
12.3 Given a custom tag, identify the necessary value for the bodycontent TLD element for any of the following tag types:
12.4 Given a tag event method (doStartTag, doAfterBody, and doEndTag), identify the correct description of the methods trigger.
12.5 Identify valid return values for the following methods:
Tag.EVAL_BODY_INCLUDE, BodyTag.EVAL_BODY_BUFFERED,//for BodyTagSupport class Tag.SKIP_BODY
IterationTag.EVAL_BODY_AGAIN, Tag.SKIP_BODY
Tag.EVAL_PAGE, Tag.SKIP_PAGE
12.6 Given a "BODY" or "PAGE" constant, identify a correct description of the constant's use in the following methods:
doStart doAfterBody doEndTag
EVAL_BODY_INCLUDE All
EVAL_BODY_BUFFERED Body tag only
EVAL_BODY_AGAIN iteration
SKIP_BODY All All
EVAL_BODY_TAG deprecated
EVAL_PAGE All
SKIP_PAGE All
12.7 Identify the method in the custom tag handler that accesses:
A PageContext instance provides access to all the namespaces associated with a JSP page, provides access to several page attributes, as well as a layer above the implementation details.
The following methods provide convenient access to implicit objects:
getOut(), getException(), getPage() getRequest(), getResponse(), getSession(), getServletConfig() getServletContext()
The following methods provide support for forwarding, inclusion and error handling:
forward(), include(), handlePageException().
The methods related to attributes are:
setAttribute(), getAttribute(), removeAttribute() - deals page scope findAttribute(), - looks in all scopes int getAttributesScope() getAttributeNamesInScope(int scope)
Note: TagSupport implements IterationTag which extends Tag. BodyTagSupport implements BodyTag which extends IterationTag.
getPreviousOut(), getBodyContent(), setBodyContent(), doInitBody()methods are defined in BodyTagSupport.
12.8 Identify methods that return an outer tag handler from within an inner tag handler.
Tag Tag.getParent() Tag TagSupport.getParent() Tag TagSupport.findAncestorWithClass(Tag from, java.lang.Class class) (A static method)