|
Version 4.10.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object SimpleTagSupport hirondelle.web4j.ui.tag.TagHelper
public abstract class TagHelper
Base class for implementing custom JSP tags.
The custom tag can optionally have a body. The .tld entry for these tags must have their body-content set to scriptless.
Concrete subclasses of this class perform these tasks :
crossCheckAttributes()
method, to
perform validations depending on more than one attribute.
getEmittedText(java.lang.String)
, to return the text to be included in markup.
Constructor Summary | |
---|---|
TagHelper()
|
Method Summary | |
---|---|
protected void |
checkForContent(String aAttributeName,
String aAttributeValue)
Verify that an attribute value has content. |
protected void |
crossCheckAttributes()
Perform validations that apply to more than one attribute. |
void |
doTag()
Template method which calls getEmittedText(String) . |
protected abstract String |
getEmittedText(String aOriginalBody)
Return the text this tag will display in the resulting web page. |
protected PageContext |
getPageContext()
Return the underlying PageContext . |
protected String |
getPageName()
Return the name of the JSP implementation class. |
protected HttpServletRequest |
getRequest()
Return the underlying HttpServletRequest . |
protected HttpServletResponse |
getResponse()
Return the underlying HttpServletResponse . |
Methods inherited from class SimpleTagSupport |
---|
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TagHelper()
Method Detail |
---|
public final void doTag() throws JspException
getEmittedText(String)
.
The body of this tag is evaluated, passed to getEmittedText(String)
,
and the result is then written to the JSP output writer. In addition, this method will call
crossCheckAttributes()
at the start of processing.
doTag
in interface SimpleTag
doTag
in class SimpleTagSupport
JspException
protected abstract String getEmittedText(String aOriginalBody) throws JspException, IOException
aOriginalBody
- is the evaluated body of this tag. If there is no body, or
if the body is present but empty, then it is null.
JspException
IOException
protected void crossCheckAttributes()
This default implementation does nothing.
Validations that apply to a single attribute should be performed in its corresponding setXXX method.
If a problem is detected, subclasses must emit a RuntimeException describing the problem. If all validations apply to only to a single attribute, then this method should not be overridden.
protected final HttpServletRequest getRequest()
HttpServletRequest
.
protected final HttpServletResponse getResponse()
HttpServletResponse
.
protected final PageContext getPageContext()
PageContext
.
protected final String getPageName()
Intended for debugging only.
protected final void checkForContent(String aAttributeName, String aAttributeValue)
If no content, then log at SEVERE and throw an unchecked exception.
|
Version 4.10.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |