jp.terasoluna.fw.web.taglib
Class IfAuthorizedTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by jp.terasoluna.fw.web.taglib.IfAuthorizedTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

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

Implementation class of ifAuthorized tag.

In case of request, body part of tag is output only when there is a access authority for the path which is specified in the path attribute. When there is no access authority, it is ignored. Access authority check is transferred to AuthorizationController.


Attribute supported by tag

In IfAuthorizedTag, following attributes are supported.

Attribute name Default value Required Execution time format Overview
path - true true Target path.
blockId - false true blockId to link with IfAuthorizedBlockTag which is the parent of this tag.

Scripting variable of custom tag

There is no scripting variable set by this tag.


How to use
 <t:ifAuthorized parh="/pathToSomewhere">
   ... // Display items only for specific user
 </t:ifAuthorized>
 

See Also:
IfAuthorizedBlockTag, AuthorizationController, Serialized Form

Field Summary
private  java.lang.String blockId
          Block ID.
private  java.lang.String path
          Path name.
private static long serialVersionUID
          Serial version ID
 
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
IfAuthorizedTag()
           
 
Method Summary
 int doEndTag()
          Method which is called at the time of terminating tag evaluation.
 int doStartTag()
          Method which is called at the time of starting tag evaluation. Check is transferred to AccessConrol and body part of tag is output when there is access authority for path. When there is no access authority, body part is skipped.
 void release()
          Process at the time of releasing the tag handler.
 void setBlockId(java.lang.String blockId)
          Sets block ID.
 void setPath(java.lang.String path)
          Sets path name.
 
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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version ID

See Also:
Constant Field Values

path

private java.lang.String path
Path name.


blockId

private java.lang.String blockId
Block ID.

Constructor Detail

IfAuthorizedTag

public IfAuthorizedTag()
Method Detail

setPath

public void setPath(java.lang.String path)
Sets path name.

Parameters:
path - Path name.

setBlockId

public void setBlockId(java.lang.String blockId)
Sets block ID.

Parameters:
blockId - Block ID

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Method which is called at the time of starting tag evaluation. Check is transferred to AccessConrol and body part of tag is output when there is access authority for path. When there is no access authority, body part is skipped.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
Process control instructions
Throws:
javax.servlet.jsp.JspException - JSP exception

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Method which is called at the time of terminating tag evaluation.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
Process control instructions
Throws:
javax.servlet.jsp.JspException - JSP exception

release

public void release()
Process at the time of releasing the tag handler.

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport