Class ApplyDecoratorTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
com.opensymphony.module.sitemesh.taglib.page.ApplyDecoratorTag
- All Implemented Interfaces:
RequestConstants,Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
public class ApplyDecoratorTag
extends javax.servlet.jsp.tagext.BodyTagSupport
implements RequestConstants
This tag inserts an external resource as a panel into the current Page.
The page attribute should point to the panel resource which should expose an entire page (e.g. another JSP file producing HTML). This attribute can be relative to the page it is being called from or an absolute path from the context-root.
OR
If the page attribute is not specified, the body content is parsed into the
Page object and has the Decorator
applied.
The (optional) decorator attribute is the name of the Decorator to apply to
the included page. Note that the implementation of DecoratorMapper can
overide this.
- Author:
- Joe Walnes
- See Also:
-
Field Summary
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContentFields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface com.opensymphony.module.sitemesh.RequestConstants
DECORATOR, PAGE, ROBOTFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintEnsure that external page contents are included in bodycontent.intdoEndTag()Standard taglib method: apply decorator to page.intvoidsetContentType(String contentType) Sets the content type.voidsetDecorator(String decorator) Deprecated.Use setName() instead.voidsetEncoding(String encoding) Sets the encoding.voidTag attribute: If set, this value will override the 'id' property of the page.voidTag attribute: Name of Decorator to apply to Page.voidTag attribute: URI of page to include.voidTag attribute: If set, this value will override the 'title' property of the page.Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContentMethods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Constructor Details
-
ApplyDecoratorTag
public ApplyDecoratorTag()
-
-
Method Details
-
setPage
Tag attribute: URI of page to include. Can be relative to page being called from, or absolute path from context-root of web-app.- Parameters:
page- the new page
-
setTitle
Tag attribute: If set, this value will override the 'title' property of the page. This is a convenience utility and is identical to specifing a 'page:param name=title' tag.- Parameters:
title- the new title
-
setId
Tag attribute: If set, this value will override the 'id' property of the page. This is a convenience utility and is identical to specifing a 'page:param name=id' tag.- Overrides:
setIdin classjavax.servlet.jsp.tagext.TagSupport
-
setName
Tag attribute: Name of Decorator to apply to Page. This is passed to DecoratorMapper to retrieve appropriate Decorator. DecoratorMapper may override if needed.- Parameters:
decorator- the new name- See Also:
-
setDecorator
Deprecated.Use setName() instead.Sets the decorator.- Parameters:
decorator- the new decorator
-
setContentType
Sets the content type.- Parameters:
contentType- the new content type
-
setEncoding
Sets the encoding.- Parameters:
encoding- the new encoding
-
doStartTag
public int doStartTag()- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.BodyTagSupport
-
doAfterBody
public int doAfterBody() throws javax.servlet.jsp.JspExceptionEnsure that external page contents are included in bodycontent.- Specified by:
doAfterBodyin interfacejavax.servlet.jsp.tagext.IterationTag- Overrides:
doAfterBodyin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException
-
doEndTag
public int doEndTag() throws javax.servlet.jsp.JspExceptionStandard taglib method: apply decorator to page.- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException
-