Package ubic.gemma.web.taglib
Class ConstantsTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
ubic.gemma.web.taglib.ConstantsTag
- All Implemented Interfaces:
Serializable,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
public class ConstantsTag
extends javax.servlet.jsp.tagext.TagSupport
This class is designed to put all the public variables in a class to a specified scope - designed for exposing a Constants class to Tag Libraries.
It is designed to be used as follows:<tag:constants />
Optional values are "className" (fully qualified) and "scope".
View Source- Author:
- Matt Raible, originally., pavlidis modified
- See Also:
-
Field Summary
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe class to expose the variables from.getScope()The scope to be put the variable in.intConverts the scope name into its corresponding PageContext constant value.getVar()The single variable to expose.voidrelease()Release all allocated resources.voidsetClassName(String className) The class to expose the variables from.voidThe scope to be put the variable in.voidThe single variable to expose.Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
-
Constructor Details
-
ConstantsTag
public ConstantsTag()
-
-
Method Details
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.TagSupport- Throws:
javax.servlet.jsp.JspException
-
getScope
Converts the scope name into its corresponding PageContext constant value.- Parameters:
scopeName- Can be "page", "request", "session", or "application" in any case.- Returns:
- The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
- Throws:
javax.servlet.jsp.JspException- if the scopeName is not a valid name.
-
release
public void release()Release all allocated resources.- Specified by:
releasein interfacejavax.servlet.jsp.tagext.Tag- Overrides:
releasein classjavax.servlet.jsp.tagext.TagSupport
-
setClassName
The class to expose the variables from. -
setScope
The scope to be put the variable in. -
setVar
The single variable to expose. -
getClassName
The class to expose the variables from. -
getScope
The scope to be put the variable in. -
getVar
The single variable to expose.
-