Package org.opencms.jsp
Class CmsJspTagInfo
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- org.opencms.jsp.CmsJspTagInfo
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.jsp.tagext.IterationTag
,javax.servlet.jsp.tagext.JspTag
,javax.servlet.jsp.tagext.Tag
public class CmsJspTagInfo extends javax.servlet.jsp.tagext.TagSupport
Provides access to OpenCms and System related information.This tag supports the following special "property" values:
opencms.version
returns the current OpenCms version, e.g. 8.0.0.opencms.url
returns the current request URL, e.g. http://localhost:8080/opencms/opencms/index.jsp.opencms.uri
returns the current request URI, e.g. /opencms/opencms/index.jsp.opencms.webapp
returns the name of the OpenCms web application, e.g. opencms.opencms.webbasepath
returns the name of system path to the OpenCms web application, e.g. C:\Java\Tomcat\webapps\opencms\.opencms.request.uri
returns the name of the currently requested URI in the OpenCms VFS, e.g. /index.jsp.opencms.request.element.uri
returns the name of the currently processed element, which might be a sub-element like a template part, in the OpenCms VFS, e.g. /system/modules/org.opencms.welcome/jsptemplates/welcome.jsp.opencms.request.folder
returns the name of the parent folder of the currently requested URI in the OpenCms VFS, e.g. /.opencms.request.encoding
returns the content encoding that has been set for the currently requested resource, e.g. ISO-8859-1.opencms.title
(since 8.0.0) returns the title of the document that should be used for the HTML title tag. This is useful for container detail pages, in which case it will return the Title of the detail, not the container page. Otherwise it just returns the value of the Title property.opencms.description
(since 9.0.1)opencms.keywords
(since 9.0.1)
System.getProperty(value)
call, so you can also get information about the Java VM environment, using values likejava.vm.version
oros.name
.If the given property value does not match a key from the special OpenCms values and also not the system values, a (String) message is returned with a formatted error message.
- Since:
- 6.0.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CmsJspTagInfo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doStartTag()
static java.lang.String
getDescriptionInfo(CmsFlexController controller, javax.servlet.http.HttpServletRequest req)
Returns the description of a page delivered from OpenCms, usually used for thedescription
metatag of a HTML page.static java.lang.String
getKeywordsInfo(CmsFlexController controller, javax.servlet.http.HttpServletRequest req)
Returns the keywords of a page delivered from OpenCms, usually used for thekeywords
metatag of a HTML page.java.lang.String
getProperty()
Returns the selected info property.static java.lang.String
getTitleInfo(CmsFlexController controller, javax.servlet.http.HttpServletRequest req)
Returns the title of a page delivered from OpenCms, usually used for the<title>
tag of a HTML page.static java.lang.String
infoTagAction(java.lang.String property, javax.servlet.http.HttpServletRequest req)
Returns the selected info property value based on the provided parameters.void
release()
void
setProperty(java.lang.String name)
Sets the info property name.
-
-
-
Constructor Detail
-
CmsJspTagInfo
public CmsJspTagInfo()
-
-
Method Detail
-
getDescriptionInfo
public static java.lang.String getDescriptionInfo(CmsFlexController controller, javax.servlet.http.HttpServletRequest req)
Returns the description of a page delivered from OpenCms, usually used for thedescription
metatag of a HTML page.If no description information has been found, the empty String "" is returned.
- Parameters:
controller
- the current OpenCms request controllerreq
- the current request- Returns:
- the description of a page delivered from OpenCms
-
getKeywordsInfo
public static java.lang.String getKeywordsInfo(CmsFlexController controller, javax.servlet.http.HttpServletRequest req)
Returns the keywords of a page delivered from OpenCms, usually used for thekeywords
metatag of a HTML page.If no description information has been found, the empty String "" is returned.
- Parameters:
controller
- the current OpenCms request controllerreq
- the current request- Returns:
- the description of a page delivered from OpenCms
-
getTitleInfo
public static java.lang.String getTitleInfo(CmsFlexController controller, javax.servlet.http.HttpServletRequest req)
Returns the title of a page delivered from OpenCms, usually used for the<title>
tag of a HTML page.If no title information has been found, the empty String "" is returned.
- Parameters:
controller
- the current OpenCms request controllerreq
- the current request- Returns:
- the title of a page delivered from OpenCms
-
infoTagAction
public static java.lang.String infoTagAction(java.lang.String property, javax.servlet.http.HttpServletRequest req)
Returns the selected info property value based on the provided parameters.- Parameters:
property
- the info property to look upreq
- the currents request- Returns:
- the looked up property value
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException
- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.TagSupport
- Throws:
javax.servlet.jsp.JspException
- See Also:
Tag.doStartTag()
-
getProperty
public java.lang.String getProperty()
Returns the selected info property.- Returns:
- the selected info property
-
release
public void release()
- Specified by:
release
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
release
in classjavax.servlet.jsp.tagext.TagSupport
- See Also:
Tag.release()
-
setProperty
public void setProperty(java.lang.String name)
Sets the info property name.- Parameters:
name
- the info property name to set
-
-