org.apache.taglibs.request
Class IsUserInRoleTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.apache.taglibs.request.IsUserInRoleTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

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

JSP Tag isuserinrole, used to determine if HttpServletRequest is for an authenticated user in a role.

Includes the body of the tag if an authenticated user in a role.

Requires that the attribute role be set.

You can set the optional tag attribute value to true or false. The body of the tag is included if isuserinrole matches the value.

JSP Tag Lib Descriptor

 <name>isuserinrole</name>
 <tagclass>org.apache.taglibs.request.IsUserInRoleTag</tagclass>
 <bodycontent>JSP</bodycontent>
 <info>Test whether the remote user is in a role.</info>
   <attribute>
     <name>role</name>
     <required>yes</required>
     <rtexprvalue>false</rtexprvalue>
   </attribute>
   <attribute>
     <name>value</name>
     <required>false</required>
     <rtexprvalue>false</rtexprvalue>
   </attribute>
 

Author:
Glenn Nielsen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
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
IsUserInRoleTag()
           
 
Method Summary
 int doStartTag()
          Determines whether remote user is in a role.
 void setRole(java.lang.String str)
          Set the required tag attribute role to the name of the role you wish to test remote user for.
 void setValue(boolean value)
          Set the optional tag attribute value to true or false.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsUserInRoleTag

public IsUserInRoleTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
Determines whether remote user is in a role.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
SKIP_BODY if isuserinrole doesn't match value, EVAL_BODY_include if isuserinrole matches value
Throws:
javax.servlet.jsp.JspException

setValue

public final void setValue(boolean value)
Set the optional tag attribute value to true or false.

Parameters:
boolean - true or false

setRole

public final void setRole(java.lang.String str)
Set the required tag attribute role to the name of the role you wish to test remote user for.

Parameters:
String - role name


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.