jp.terasoluna.fw.web.taglib
Class IfAuthorizedBlockTag

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

public class IfAuthorizedBlockTag
extends javax.servlet.jsp.tagext.BodyTagSupport

Implementation class of ifAuthorizedBlock tag.

This tag controls the result of IfAuthorizedTag for each blockId. It is linked with IfAuthorizedTag through blockId and checks whether to display the contents in the body.
Converting this tag into the nested condition enables to easily perform the access control based on each permission. At the time of converting this tag into nested condition, blockId attribute of parent tag and parentBlockId tag of child tag are linked to check whether to display the contents in body.


attribute supported by tag

In IfAuthorizedBlockTag, following attributes are supported.

Attribute name Default value Required Execution time format Overview
blockId - true true Target blockId.
parentBlockId - false true blockId to link with the 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:ifAthorizedBlock blockId="ABC" >
     is displayed only when IfAuthorizedBlockTag 
     which is linked with  blockId in the body.

     <t:ifAthorizedBlock blockId="EFG" parentBlockId="ABC" >
      is displayed only when the IfAuthorizedTag
      which is linked with blockId in the body is displayed.

         <t:ifAthorized path="/sample1/test.do blockId="EFG" >
             It is output when there is a access authority to the specified path.
         </t:ifAthorized>

     </t:ifAthorizedBlock>
 </t:ifAthorizedBlock>
 

See Also:
IfAuthorizedTag, Serialized Form

Field Summary
private  java.lang.String blockId
          Block ID.
private static org.apache.commons.logging.Log log
          Log class
private  java.lang.String parentBlockId
          Parent block ID.
private static long serialVersionUID
          Serial version ID
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
IfAuthorizedBlockTag()
           
 
Method Summary
 int doAfterBody()
          Method which is called at the time of ending tag body.
 int doEndTag()
          Method which is called at the time of ending the tag evaluation.
 int doStartTag()
          Method which is called at the time of starting tag evaluation.
 void release()
          Process at the time of releasing the tag handler.
 void setBlockId(java.lang.String blockId)
          Sets block ID.
 void setParentBlockId(java.lang.String parentBlockId)
          Sets parent block ID.
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
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
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial version ID

See Also:
Constant Field Values

log

private static org.apache.commons.logging.Log log
Log class


blockId

private java.lang.String blockId
Block ID.


parentBlockId

private java.lang.String parentBlockId
Parent block ID.

Constructor Detail

IfAuthorizedBlockTag

public IfAuthorizedBlockTag()
Method Detail

setBlockId

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

Parameters:
blockId - Block ID

setParentBlockId

public void setParentBlockId(java.lang.String parentBlockId)
Sets parent block ID.

Parameters:
parentBlockId - Parent block ID

doStartTag

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

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

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Method which is called at the time of ending tag body.

Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
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 ending tag evaluation.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
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.BodyTagSupport