Class RoleAttributeTag

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.deltava.taglib.content.RoleAttributeTag
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag

public class RoleAttributeTag extends TagSupport
A JSP Tag to set an attribute based on role membership.
Since:
2.6
Version:
7.0
Author:
Luke
See Also:
  • Constructor Details

    • RoleAttributeTag

      public RoleAttributeTag()
  • Method Details

    • setAttr

      public void setAttr(String attrName)
      Sets the request attribute name.
      Parameters:
      attrName - the attribute name
    • setValue

      public void setValue(Object attrValue)
      Sets the request attribute value.
      Parameters:
      attrValue - the attribute value
    • setRoles

      public void setRoles(String roles)
      Sets the role(s) a user must belong to in order to view the body of this tag. Use * (asterisk) for all roles, and a role name prefaced by an ! (exclamation mark) for the lack of role memebrship.
      Parameters:
      roles - a comma-delimited list of authorized role names
    • release

      public void release()
      Clears state by reseting the role list.
      Specified by:
      release in interface Tag
      Overrides:
      release in class TagSupport
    • doStartTag

      public int doStartTag()
      Checks for the roles listed and adds the attribute to the request if found.
      Specified by:
      doStartTag in interface Tag
      Overrides:
      doStartTag in class TagSupport
      Returns:
      SKIP_BODY always
    • doEndTag

      public int doEndTag()
      Closes the JSP and releases state.
      Specified by:
      doEndTag in interface Tag
      Overrides:
      doEndTag in class TagSupport
      Returns:
      EVAL_PAGE always