net.sf.jguard.jee.taglib
Class HasPrincipal

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.jstl.core.ConditionalTagSupport
          extended by net.sf.jguard.jee.taglib.HasPrincipal
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

public class HasPrincipal
extends javax.servlet.jsp.jstl.core.ConditionalTagSupport

display the jsp fragment if the Subject has got this Principal/role. principals are divided by ';' character, which are divided with ',' to include multiple strings to build the principal.

Author:
Charles Gay
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
HasPrincipal()
           
 
Method Summary
protected  boolean condition()
          allow or not to display jsp content;depends on user's principalsArray (Principals).
 String getApplicationName()
           
 Class getClazz()
           
 String getOperator()
           
 Class[] getParameterTypes()
           
 String getPrincipals()
           
 void setApplicationName(String applicationName)
           
 void setClassName(String className)
           
 void setOperator(String operator)
           
 void setPrincipals(String strUri)
           
 
Methods inherited from class javax.servlet.jsp.jstl.core.ConditionalTagSupport
doStartTag, release, setScope, setVar
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, 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
 

Constructor Detail

HasPrincipal

public HasPrincipal()
Method Detail

setPrincipals

public void setPrincipals(String strUri)
Parameters:
strUri -

condition

protected boolean condition()
                     throws javax.servlet.jsp.JspTagException
allow or not to display jsp content;depends on user's principalsArray (Principals).

Specified by:
condition in class javax.servlet.jsp.jstl.core.ConditionalTagSupport
Returns:
true if tag displays content when user has got the specified role(principal); false otherwise
Throws:
javax.servlet.jsp.JspTagException
See Also:
ConditionalTagSupport.condition()

getPrincipals

public String getPrincipals()
Returns:
Returns the principals.

getOperator

public String getOperator()
Returns:
Returns the operator.

setOperator

public void setOperator(String operator)
Parameters:
operator - The operator to set.

getClazz

public final Class getClazz()

setClassName

public final void setClassName(String className)

getParameterTypes

public final Class[] getParameterTypes()

getApplicationName

public String getApplicationName()

setApplicationName

public void setApplicationName(String applicationName)


Copyright © 2004-2011. All Rights Reserved.