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 current `Environment` using one of the supported `Scope`s.

  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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Attribute.Mode` the mode for an `Attribute`

  - ### Field Summary

    - ### Fields inherited from class javax.servlet.jsp.tagext.TagSupport

      `id, pageContext`

    - ### Fields inherited from interface javax.servlet.jsp.tagext.Tag

      `EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE`

    - ### Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

      `EVAL_BODY_AGAIN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Attribute()`
    `Attribute(String scope, String name)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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`

    - ### 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 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)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.