Class 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 current Environment using one of the supported Scopes.

    For write-mode, only Scope.REQUEST and Scope.SESSION are supported.

    In read-mode, you can also "navigate" through objects that are present in the current scope, for example SESSION.currentSubject.realname, where SESSION.currentSubject is the name of the attribute (which is a Subject) and realname is a property of the subject.

    Usage:
     <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
    • Constructor Detail

      • Attribute

        public Attribute​(String scope,
                         String name)
      • Attribute

        public Attribute()
    • Method Detail

      • doEndTag

        public int doEndTag()
                     throws javax.servlet.jsp.JspException
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class javax.servlet.jsp.tagext.TagSupport
        Throws:
        javax.servlet.jsp.JspException
      • doStartTag

        public int doStartTag()
        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class javax.servlet.jsp.tagext.TagSupport
      • release

        public void release()
        Specified by:
        release in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        release in class javax.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)