|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.tagext.SimpleTagSupport
nl.gx.webmanager.taglib.RenderExtensionTag
public class RenderExtensionTag
Implements the wm:renderExtension tag.
<wm:renderExtension var="pollForm" presentationName="WM pollelement form" />
<wm:renderExtension var="pollResult" presentationName="WM pollelement result" />
In this example a poll element object is rendered with two different presentations. In this case the
default presentation of the poll element (wm_poll_element) is not used because the optional presentationName is
provided.
Additionally, no object is specified which means that the object that is being rendered is the same as the object
that is rendered by the jsp this code is in. Actually this example comes from pollElement.jspf which is used to
render the pollElement. Depending on weather the user has submitted the poll, either the form for doing so should
be displayed or otherwise the poll results should be displayed. The example renders both the form and the results
into separate variables. The remainder of the logic in pollElement.jspf determinse what is actually printed in the
page.
You can also explicitly specify an object and no presentation. This is done in content.jspf, for example:
<wm:renderExtension object="${element}" />
This render tag renders the object ${element} (the jsp loops over all page elements) with whatever presentationname
is associated with the object in GX WebManager.
| Constructor Summary | |
|---|---|
RenderExtensionTag()
|
|
| Method Summary | |
|---|---|
void |
doTag()
|
static java.lang.String |
getContent(java.lang.Object object,
Presentation presentation,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Get rendered string for a presentable object given a presentation, request & response. |
protected java.lang.Object |
getExtension()
Return object or null. |
protected java.lang.String |
getPresentationName()
Return presentation name. |
protected java.lang.String |
getVar()
Return var name or null if it is not set. |
void |
setDynamicAttribute(java.lang.String uri,
java.lang.String localName,
java.lang.Object value)
|
void |
setExtension(java.lang.Object object)
Setter for the optional attribute object. |
void |
setPresentationName(java.lang.String presentationName)
Setter for the required attribute presentationName. |
void |
setVar(java.lang.String var)
Setter for the optional attribute var. |
| Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport |
|---|
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RenderExtensionTag()
| Method Detail |
|---|
public void setPresentationName(java.lang.String presentationName)
presentationName - protected java.lang.String getPresentationName()
public void setVar(java.lang.String var)
var - protected java.lang.String getVar()
public void setExtension(java.lang.Object object)
object - protected java.lang.Object getExtension()
public void setDynamicAttribute(java.lang.String uri,
java.lang.String localName,
java.lang.Object value)
setDynamicAttribute in interface javax.servlet.jsp.tagext.DynamicAttributes
public void doTag()
throws javax.servlet.jsp.JspException
doTag in interface javax.servlet.jsp.tagext.SimpleTagdoTag in class javax.servlet.jsp.tagext.SimpleTagSupportjavax.servlet.jsp.JspException
public static java.lang.String getContent(java.lang.Object object,
Presentation presentation,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
presentable - presentation - request - response -
java.io.IOException
javax.servlet.ServletException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||