com.taggercat.tags
Class RoleContentTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.taggercat.tags.RoleContentTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class RoleContentTag
extends javax.servlet.jsp.tagext.TagSupport

This tag bounds a region that is included /not included based on the current user's group membership. An example:


<tc:roleContent roles="Admin,Accounting" show="true" >
Content that only Admin, and Accounting role members will see
</tc:roleContent>

See Also:
Serialized Form
 

Field Summary
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
RoleContentTag()
          Creates a new tag instance.
 
Method Summary
 int doEndTag()
           
 int doStartTag()
          Process the body of the tag.
 void setRoles(java.lang.String roleNames)
          Sets the roles names to grant / restrict access to / from.
 void setShow(java.lang.String show)
          Sets the show attribute.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleContentTag

public RoleContentTag()
Creates a new tag instance.

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()
               throws javax.servlet.jsp.JspException
Process the body of the tag.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException
Returns:
Description of the Returned Value

setRoles

public void setRoles(java.lang.String roleNames)
Sets the roles names to grant / restrict access to / from.

Parameters:
roleNames - the role names as a comma separated list

setShow

public void setShow(java.lang.String show)
Sets the show attribute. If show is "true" ( the default value) and the user is a member of one or more of the specified roles then the tag body region is displayed. If the user is not a member of a specified role, then the tag body region is not displayed.

If show is "false" and the user is a member of one or more roles then the tag body region is NOT displayed. If the user is a member of a specified role, then the tag body region is not displayed.

Parameters:
show - the new show value