org.apache.tiles.jsp.taglib
abstract public class: ContainerTagSupport [javadoc |
source]
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport
org.apache.tiles.jsp.taglib.ContainerTagSupport
All Implemented Interfaces:
BodyTag, IterationTag, Serializable
Direct Known Subclasses:
RenderTagSupport, InsertDefinitionTag, InsertTemplateTag, InsertAttributeTag, GetAsStringTag
Base tag for the tiles tags which interact with the container.
Provides standard support for security, and provides access
to the container and attribute context.
- since:
Tiles - 2.0
- version:
$ - Rev: 527536 $ $Date: 2007-04-11 17:44:51 +0200 (Wed, 11 Apr 2007) $
| Field Summary |
|---|
| protected TilesContainer | container | The Tiles container that can be used inside the tag. |
| protected AttributeContext | attributeContext | The attribute context to use to store and read attribute values. |
| Methods from javax.servlet.jsp.tagext.TagSupport: |
|---|
|
doAfterBody, doEndTag, doStartTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
| Method from org.apache.tiles.jsp.taglib.ContainerTagSupport Detail: |
public int doEndTag() throws JspException {
try {
return super.doEndTag();
} finally {
endContext(pageContext);
}
}
|
public int doStartTag() throws JspException {
container = TilesAccess.getContainer(pageContext.getServletContext());
if (container != null) {
startContext(pageContext);
return EVAL_BODY_BUFFERED;
} else {
throw new JspException("TilesContainer not initialized");
}
}
By default, all ContainerTags evaluate their body. Subclasses may choose to be more selective.
In any case, children can rely upon the container and attributeContext being initialized if they
call super.doStartTag() |
protected void endContext(PageContext context) {
if (attributeContext != null && container != null) {
container.endContext(pageContext);
}
}
Ends the context when exiting the tag. |
public void release() {
super.release();
this.container = null;
this.attributeContext = null;
}
|
protected void startContext(PageContext context) {
if (container != null) {
attributeContext = container.startContext(pageContext);
}
}
Starts the context when entering the tag. |