Package org.appng.taglib
Class Attribute
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- org.appng.taglib.Attribute
-
- All Implemented Interfaces:
Serializable
,javax.servlet.jsp.tagext.IterationTag
,javax.servlet.jsp.tagext.JspTag
,javax.servlet.jsp.tagext.Tag
public class Attribute extends javax.servlet.jsp.tagext.TagSupport implements javax.servlet.jsp.tagext.Tag
This class defines an attribute tag which can be used in JSPs.
It is used to read attributes from/write attributes to the currentEnvironment
using one of the supportedScope
s.For write-mode, only
Scope.REQUEST
andScope.SESSION
are supported.In read-mode, you can also "navigate" through objects that are present in the current scope, for example
Usage:SESSION.currentSubject.realname
, whereSESSION.currentSubject
is the name of the attribute (which is aSubject
) andrealname
is a property of the subject.<appNG:attribute scope="SESSION" mode="read" name="foo" /> <appNG:attribute scope="REQUEST" mode="read" name="bar" /> <appNG:attribute scope="SESSION" mode="write" name="someName" value="someValue"/> <-- for URL-scope, the name is the zero based index of the path segment (segments are separated by '/') --> <-- for example, if the path is '/en/foo/bar/42' then you can access the '42' with index 3--> <appNG:attribute scope="URL" mode="read" name="3" />
- Author:
- Matthias Herlitzius, Matthias Müller
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Attribute.Mode
the mode for anAttribute
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doEndTag()
int
doStartTag()
String
getMode()
String
getName()
String
getScope()
String
getValue()
void
release()
void
setMode(String mode)
void
setName(String name)
void
setScope(String scope)
void
setValue(String value)
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
-
-
-
-
Method Detail
-
doEndTag
public int doEndTag() throws javax.servlet.jsp.JspException
- Specified by:
doEndTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjavax.servlet.jsp.tagext.TagSupport
- Throws:
javax.servlet.jsp.JspException
-
doStartTag
public int doStartTag()
- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.TagSupport
-
release
public void release()
- Specified by:
release
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
release
in classjavax.servlet.jsp.tagext.TagSupport
-
getName
public String getName()
-
setName
public void setName(String name)
-
getValue
public String getValue()
-
setValue
public void setValue(String value)
-
getMode
public String getMode()
-
setMode
public void setMode(String mode)
-
getScope
public String getScope()
-
setScope
public void setScope(String scope)
-
-