Package org.opencms.jsp
Class CmsJspTagInclude
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opencms.jsp.CmsJspTagInclude
- All Implemented Interfaces:
Serializable
,javax.servlet.jsp.tagext.BodyTag
,javax.servlet.jsp.tagext.IterationTag
,javax.servlet.jsp.tagext.JspTag
,javax.servlet.jsp.tagext.Tag
,I_CmsJspTagParamParent
public class CmsJspTagInclude
extends javax.servlet.jsp.tagext.BodyTagSupport
implements I_CmsJspTagParamParent
Implementation of the
<cms:include/>
tag,
used to include another OpenCms managed resource in a JSP.- Since:
- 6.0.0
- See Also:
-
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
ConstructorDescriptionEmpty constructor, required for attribute value initialization. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addParameter
(String name, String value) This methods adds parameters to the current request.static void
Adds parameters to a parameter Map that can be used for a http request.int
doEndTag()
int
Returns
.BodyTag.EVAL_BODY_BUFFERED
Returns the attribute.Returns the cacheable flag.Returns the editable flag.Returns the element.getFile()
Returns the value of
.getPage()
getPage()
Returns the include page target.Returns the property.Returns the suffix.static void
includeTagAction
(javax.servlet.jsp.PageContext context, String target, String element, boolean editable, Map<String, String[]> paramMap, Map<String, Object> attrMap, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) Includes the selected target.static void
includeTagAction
(javax.servlet.jsp.PageContext context, String target, String element, Locale locale, boolean editable, boolean cacheable, Map<String, String[]> paramMap, Map<String, Object> attrMap, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) Includes the selected target.void
release()
void
setAttribute
(String attribute) Sets the attribute.void
setCacheable
(String cacheable) Sets the cacheable flag.void
setEditable
(String editable) Sets the editable flag.void
setElement
(String element) Sets the element.void
Sets the file, same as usingsetPage()
.void
Sets the include page target.void
setProperty
(String property) Sets the property.void
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 Details
-
CmsJspTagInclude
public CmsJspTagInclude()Empty constructor, required for attribute value initialization.
-
-
Method Details
-
addParameter
public static void addParameter(Map<String, String[]> parameters, String name, String value, boolean overwrite) Adds parameters to a parameter Map that can be used for a http request.- Parameters:
parameters
- the Map to add the parameters toname
- the name to addvalue
- the value to addoverwrite
- iftrue
, 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)
-
includeTagAction
public static void includeTagAction(javax.servlet.jsp.PageContext context, String target, String element, boolean editable, Map<String, String[]> paramMap, Map<String, throws javax.servlet.jsp.JspExceptionObject> attrMap, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) Includes the selected target.- Parameters:
context
- the current JSP page contexttarget
- the target for the include, might benull
element
- the element to select form the target might benull
editable
- flag to indicate if the target is editableparamMap
- a map of parameters for the include, will be merged with the request parameters, might benull
attrMap
- a map of attributes for the include, will be merged with the request attributes, might benull
req
- the current requestres
- the current response- Throws:
javax.servlet.jsp.JspException
- in case something goes wrong
-
includeTagAction
public static void includeTagAction(javax.servlet.jsp.PageContext context, String target, String element, Locale locale, boolean editable, boolean cacheable, Map<String, String[]> paramMap, Map<String, throws javax.servlet.jsp.JspExceptionObject> attrMap, javax.servlet.ServletRequest req, javax.servlet.ServletResponse res) Includes the selected target.- Parameters:
context
- the current JSP page contexttarget
- the target for the include, might benull
element
- the element to select form the target, might benull
locale
- the locale to use for the selected element, might benull
editable
- flag to indicate if the target is editablecacheable
- flag to indicate if the target should be cacheable in the Flex cacheparamMap
- a map of parameters for the include, will be merged with the request parameters, might benull
attrMap
- a map of attributes for the include, will be merged with the request attributes, might benull
req
- the current requestres
- the current response- Throws:
javax.servlet.jsp.JspException
- in case something goes wrong
-
addParameter
This methods adds parameters to the current request.Parameters added here will be treated like parameters from the HttpRequest on included pages.
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.
- Specified by:
addParameter
in interfaceI_CmsJspTagParamParent
- Parameters:
name
- the name to addvalue
- the value to add- See Also:
-
doEndTag
- Specified by:
doEndTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Returns:
EVAL_PAGE
- Throws:
javax.servlet.jsp.JspException
- by interface default- See Also:
-
Tag.doEndTag()
-
doStartTag
Returns
.BodyTag.EVAL_BODY_BUFFERED
- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Returns:
BodyTag.EVAL_BODY_BUFFERED
- See Also:
-
Tag.doStartTag()
-
getAttribute
Returns the attribute.- Returns:
- the attribute
-
getCacheable
Returns the cacheable flag.- Returns:
- the cacheable flag
-
getEditable
Returns the editable flag.- Returns:
- the editable flag
-
getElement
Returns the element.- Returns:
- the element
-
getFile
Returns the value of
.getPage()
-
getPage
Returns the include page target.- Returns:
- the include page target
-
getProperty
Returns the property.- Returns:
- the property
-
getSuffix
Returns the suffix.- Returns:
- the suffix
-
release
- Specified by:
release
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
release
in classjavax.servlet.jsp.tagext.BodyTagSupport
- See Also:
-
Tag.release()
-
setAttribute
Sets the attribute.- Parameters:
attribute
- the attribute to set
-
setCacheable
Sets the cacheable flag.Cachable is
true
by default.- Parameters:
cacheable
- the flag to set
-
setEditable
Sets the editable flag.Editable is
false
by default.- Parameters:
editable
- the flag to set
-
setElement
Sets the element.- Parameters:
element
- the element to set
-
setFile
Sets the file, same as usingsetPage()
.- Parameters:
file
- the file to set- See Also:
-
setPage
Sets the include page target.- Parameters:
target
- the target to set
-
setProperty
Sets the property.- Parameters:
property
- the property to set
-
setSuffix
Sets the suffix.- Parameters:
suffix
- the suffix to set
-