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
Pageobject and has theDecoratorapplied.The (optional) decorator attribute is the name of the
Decoratorto apply to the included page. Note that the implementation ofDecoratorMappercan overide this.- Version:
- $Revision: 1.10 $
- Author:
- Joe Walnes
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classApplyDecoratorTag.ApplyDecoratorException
-
Field Summary
Fields Modifier and Type Field Description private Configconfigprivate StringcontentTypeprivate Stringdecoratorprivate DecoratorMapperdecoratorMapperprivate Stringencodingprivate Factoryfactoryprivate Stringpageprivate Mapparams-
Fields inherited from interface com.opensymphony.module.sitemesh.RequestConstants
DECORATOR, PAGE, ROBOT
-
-
Constructor Summary
Constructors Constructor Description ApplyDecoratorTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) voidaddParam(String name, String value)Add a parameter to the page.intdoAfterBody()Ensure that external page contents are included in bodycontent.intdoEndTag()Standard taglib method: apply decorator to page.intdoStartTag()private PageParserSelectorgetParserSelector()voidsetContentType(String contentType)voidsetDecorator(String decorator)Deprecated.Use setName() instead.voidsetEncoding(String encoding)voidsetId(String id)Tag attribute: If set, this value will override the 'id' property of the page.voidsetName(String decorator)Tag attribute: Name of Decorator to apply to Page.voidsetPage(String page)Tag attribute: URI of page to include.voidsetTitle(String title)Tag 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, setBodyContent
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
-
-
-
-
Method Detail
-
setPage
public void setPage(String page)
Tag attribute: URI of page to include. Can be relative to page being called from, or absolute path from context-root of web-app.
-
addParam
void addParam(String name, String value)
Add a parameter to the page. This has a package level access modifier so ParamTag can also call it.
-
setTitle
public void setTitle(String title)
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.
-
setId
public void setId(String id)
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
public void setName(String decorator)
Tag attribute: Name of Decorator to apply to Page. This is passed to DecoratorMapper to retrieve appropriate Decorator. DecoratorMapper may override if needed.- See Also:
DecoratorMapper
-
setDecorator
public void setDecorator(String decorator)
Deprecated.Use setName() instead.
-
setContentType
public void setContentType(String contentType)
-
setEncoding
public void setEncoding(String 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
-
getParserSelector
private PageParserSelector getParserSelector()
-
-