jp.terasoluna.fw.web.struts.taglib
Class IfErrorsTag

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

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

Implementation class of ifErrors tag.

When there is input check error or error information is set in the output parameter, the body part of tag is output.

When there is a error in the standard process method of Struts,error information list is set in "request" attribute or "session" attribute. In IfErrorsTag, when "request" attribute or "session" attribute is checked and error information list is set, body part is output. When error information list is not set in "Request" attribute or "Session" attribute, it is ignored.

On contrary to IfErrorsTag, when there is no error or body part is to be output, IfNotErrorsTag should be used.


Attribute supported by tag

There is no attribute set by this tag.


Scripting variable of custom tag

There is no scripting variable set by this tag.


How to use

 <ts:ifErrors >
   ... // Display items when there is error
 </ts:ifErrors>
 

See Also:
Serialized Form

Field Summary
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
IfErrorsTag()
           
 
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. When error information list is set in "request" or "session", body part is output. When it is not set, body part is skipped.
 
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
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
Constructor Detail

IfErrorsTag

public IfErrorsTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Method which is called at the time of starting tag evaluation.When error information list is set in request or session, body part is output. When it is not set, 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