|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspTagInclude
public class CmsJspTagInclude
Used to include another OpenCms managed resource in a JSP.
| Field Summary |
|---|
| Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
|---|
bodyContent |
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
id, pageContext |
| Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
|---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
|---|
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
|---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Constructor Summary | |
|---|---|
CmsJspTagInclude()
|
|
| Method Summary | |
|---|---|
static void |
addParameter(Map parameters,
String name,
String value,
boolean overwrite)
Adds parameters to a parameter Map that can be used for a http request. |
void |
addParameter(String name,
String value)
This methods adds parameters to the current request. |
int |
doEndTag()
|
int |
doStartTag()
|
String |
getAttribute()
Returns the attribute. |
String |
getEditable()
Returns the editable flag. |
String |
getElement()
Returns the element. |
String |
getFile()
Returns the value of getPage(). |
String |
getPage()
Returns the include page target. |
String |
getProperty()
Returns the property. |
String |
getSuffix()
Returns the suffix. |
static void |
includeTagAction(PageContext context,
String target,
String element,
boolean editable,
Map paramMap,
ServletRequest req,
ServletResponse res)
Include action method. |
void |
release()
|
void |
setAttribute(String attribute)
Sets the attribute. |
void |
setEditable(String editable)
Sets the editable flag. |
void |
setElement(String element)
Sets the element. |
void |
setFile(String file)
Sets the file, same as using setPage(). |
void |
setPage(String target)
Sets the include page target. |
void |
setProperty(String property)
Sets the property. |
void |
setSuffix(String suffix)
Sets the suffix. |
| Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
|---|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.jsp.tagext.Tag |
|---|
getParent, setPageContext, setParent |
| Constructor Detail |
|---|
public CmsJspTagInclude()
| Method Detail |
|---|
public static void addParameter(Map parameters,
String name,
String value,
boolean overwrite)
parameters - the Map to add the parameters toname - the name to addvalue - the value to addoverwrite - if true, a parameter in the map will be overwritten by
a parameter with the same name, otherwise the request will have multiple parameters
with the same name (which is possible in http requests)
public static void includeTagAction(PageContext context,
String target,
String element,
boolean editable,
Map paramMap,
ServletRequest req,
ServletResponse res)
throws JspException
The logic in this mehod is more complex than it should be. This is because of the XMLTemplate integration, which requires some settings to the parameters understandable only to XMLTemplate gurus. By putting this logic here it is not required to care about these issues on JSP pages, and you end up with considerable less JSP code. Also JSP developers need not to know the intrinsics of XMLTemplates this way.
context - the current JSP page contexttarget - the target for the include, might be nullelement - the element to select form the target might be nulleditable - the flag to indicate if the target is editableparamMap - a map of parameters for the include, will be merged with the request
parameters, might be nullreq - the current requestres - the current response
JspException - in case something goes wrong
public void addParameter(String name,
String value)
Remember that the value for a parameter in a HttpRequest is a String array, not just a simple String. If a parameter added here does not already exist in the HttpRequest, it will be added. If a parameter exists, another value will be added to the array of values. If the value already exists for the parameter, nothing will be added, since a value can appear only once per parameter.
addParameter in interface I_CmsJspTagParamParentname - the name to addvalue - the value to addI_CmsJspTagParamParent.addParameter(String, String)
public int doEndTag()
throws JspException
doEndTag in interface TagdoEndTag in class BodyTagSupportEVAL_PAGE
JspException - by interface defaultTag.doEndTag()public int doStartTag()
doStartTag in interface TagdoStartTag in class BodyTagSupportEVAL_BODY_BUFFEREDTag.doStartTag()public String getAttribute()
public String getEditable()
public String getElement()
public String getFile()
getPage().
getPage()getPage()public String getPage()
public String getProperty()
public String getSuffix()
public void release()
release in interface Tagrelease in class BodyTagSupportTag.release()public void setAttribute(String attribute)
attribute - the attribute to setpublic void setEditable(String editable)
editable - the flag to setpublic void setElement(String element)
element - the element to setpublic void setFile(String file)
setPage().
file - the file to setsetPage(String)public void setPage(String target)
target - the target to setpublic void setProperty(String property)
property - the property to setpublic void setSuffix(String suffix)
suffix - the suffix to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||