org.apache.struts.taglib
Class ErrorsTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--org.apache.struts.taglib.ErrorsTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public final class ErrorsTag
extends javax.servlet.jsp.tagext.TagSupport

Custom tag that renders error messages if an appropriate request attribute has been created. The tag looks for a request attribute with a reserved key, and assumes that it is either a String, or a String array, containing message keys to be looked up in the application's MessageResources.

The following optional message keys will be utilized if corresponding messages exist for them in the application resources:

Version:
$Revision: 1.9 $ $Date: 2000/10/12 21:52:52 $
Author:
Craig R. McClanahan
See Also:
Serialized Form

Field Summary
private static java.util.Locale defaultLocale
          The default locale on our server.
private  java.lang.String name
          Name of the request scope attribute containing our error messages, if any.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext, parent, values
 
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
ErrorsTag()
           
 
Method Summary
 int doStartTag()
          Render the specified error messages if there are any.
 java.lang.String getName()
          Return the errors attribute name.
 void release()
          Release any acquired resources.
 void setName(java.lang.String name)
          Set the errors attribute name.
 
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, registerNatives, toString, wait, wait, wait
 

Field Detail

defaultLocale

private static java.util.Locale defaultLocale
The default locale on our server.

name

private java.lang.String name
Name of the request scope attribute containing our error messages, if any.
Constructor Detail

ErrorsTag

public ErrorsTag()
Method Detail

getName

public java.lang.String getName()
Return the errors attribute name.

setName

public void setName(java.lang.String name)
Set the errors attribute name.
Parameters:
name - The new errors attribute name

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Render the specified error messages if there are any.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

release

public void release()
Release any acquired resources.
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport


Copyright © 2000-2002 - Apache Software Foundation