Package nl.gx.webmanager.taglib
Class RenderTag
- java.lang.Object
-
- javax.servlet.jsp.tagext.SimpleTagSupport
-
- nl.gx.webmanager.taglib.RenderTag
-
- All Implemented Interfaces:
javax.servlet.jsp.tagext.DynamicAttributes
,javax.servlet.jsp.tagext.JspTag
,javax.servlet.jsp.tagext.SimpleTag
- Direct Known Subclasses:
PagePartTag
public class RenderTag extends javax.servlet.jsp.tagext.SimpleTagSupport implements javax.servlet.jsp.tagext.DynamicAttributes
Implements thewm:render
tag.
Example of usage (1):<wm:render var="headTag" presentationName="WM custom head tag" /> <wm:render var="bodyTag" presentationName="WM custom body tag" />
In the example above a custom head tag and body tag for a page are rendered using two different presentations. In this case the default presentation of the content item is not used because the optional presentationName is provided in the < wm:render > tag. Additionally, no object is specified which means that the object which is being rendered is the same as the object that is rendered by the jsp this code is in. The example renders both the head and body tag into separate variables. You can also explicitly specify an object and no presentation. This is done in the following example.
Example of usage (2):<wm:render object="${element}" />
The < wm:render > tag renders the object ${element} using whatever presentation is associated with the object in GX WebManager.
-
-
Constructor Summary
Constructors Constructor Description RenderTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doTag()
protected Presentable
getObject()
Return the object to render or null.protected String
getPresentationName()
Return the name of the presentation that the object should be rendered with.protected String
getVar()
Return the name of the JSP variable to store the result in or null if it is not set.void
setDynamicAttribute(String uri, String localName, Object value)
void
setObject(Presentable object)
Specifies the object to render.void
setPresentationName(String presentationName)
Sets the presentation that the object should be rendered with.void
setVar(String var)
Specifies the JSP variable to store the result in.
-
-
-
Method Detail
-
setPresentationName
public void setPresentationName(String presentationName)
Sets the presentation that the object should be rendered with. Default value is empty, which means the object is rendered using the presentation assigned in WebManager.- Parameters:
presentationName
- the presentation that the object should be rendered with
-
getPresentationName
protected String getPresentationName()
Return the name of the presentation that the object should be rendered with.- Returns:
- the name of the presentation that the object should be rendered with.
-
setVar
public void setVar(String var)
Specifies the JSP variable to store the result in.- Parameters:
var
- the JSP variable to store the result in
-
getVar
protected String getVar()
Return the name of the JSP variable to store the result in or null if it is not set.- Returns:
- var name or null if it is not set.
-
setObject
public void setObject(Presentable object)
Specifies the object to render. Default value is �${presentationcontext.baseObject}�, the object that is rendered by the jsp this tag is in.- Parameters:
object
- the object to render
-
getObject
protected Presentable getObject()
Return the object to render or null.- Returns:
- object or null.
-
setDynamicAttribute
public void setDynamicAttribute(String uri, String localName, Object value)
- Specified by:
setDynamicAttribute
in interfacejavax.servlet.jsp.tagext.DynamicAttributes
-
doTag
public void doTag() throws javax.servlet.jsp.JspException
- Specified by:
doTag
in interfacejavax.servlet.jsp.tagext.SimpleTag
- Overrides:
doTag
in classjavax.servlet.jsp.tagext.SimpleTagSupport
- Throws:
javax.servlet.jsp.JspException
-
-