BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.

com.bea.wlw.netui.tags.html
Class Error

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by com.bea.wlw.netui.tags.AbstractBaseTag
              extended by com.bea.wlw.netui.tags.html.Error
All Implemented Interfaces:
HtmlConstants, Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class Error
extends AbstractBaseTag

Renders an error message with a given error key value if that key can be found in the ActionErrors registered in the pageContext at org.apache.struts.action.Action.ERROR_KEY. Error ignores its body content.

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

Attribute Descriptions
AttributeRequiredRuntime Expression EvaluationData Bindable
bundleNoNoNo
The message bundle where the error message can be found
localeNoNoNo
The session attribute key for the locale
valueYesNoRead Only
The value for getting the error key

See Also:
Errors, Serialized Form
Example:
In this sample, the "InvalidName" message from the errorMessages bundle will be used to output the error.
 <netui:error bundle="com.project.errorMessages" value="InvalidName"/>

Code Sample

[BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/struts/validation/basic/formPage.jsp [BEA_HOME]/weblogic81/samples/workshop/SamplesApp/WebApp/struts/validation/validator/formPage.jsp
Beadoc.see:
Form Validation Sample
Beadoc.tagdescription:
Renders an error message with a given error key value if that key can be found in the ActionErrors registered in the PageContext at org.apache.struts.action.Action.ERROR_KEY.

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

  • error.prefix - If present, the corresponding message will be rendered before each individual error message.
  • error.suffix - If present, the corresponding message will be rendered after each individual error message.

Field Summary
protected  String bundle
          The message bundle where the error messages can be found.
protected static Locale defaultLocale
          The default locale on the server.
protected  String locale
          The session attribute key for the locale.
protected  String value
          The value for getting the error key.
 
Fields inherited from class com.bea.wlw.netui.tags.AbstractBaseTag
ATTR_GENERAL, ATTR_GENERAL_EXPRESSION, ATTR_JAVASCRIPT, ATTR_STYLE, JAVASCRIPT_STATUS, NETUI_UNIQUE_CNT
 
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 com.bea.wlw.netui.tags.html.HtmlConstants
ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, RULES, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TD, TEXT, TEXTAREA, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH
 
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
Error()
           
 
Method Summary
 int doStartTag()
          Render the specified error message if it can be found.
 String getBundle()
          Returns the name of the message bundle.
 String getLocale()
          Returns the name of the locale attribute.
 String getTagName()
          Return the name of the Tag.
 String getValue()
          Returns the value of the error key.
protected  void localRelease()
          Release any acquired resources.
 void setBundle(String bundle)
          Set the name of the message bundle.
 void setLocale(String locale)
          Set the name of the locale attribute.
 void setValue(String value)
          Set the value of the error key.
 
Methods inherited from class com.bea.wlw.netui.tags.AbstractBaseTag
addTagIdMapping, containsExpression, evaluateAttributeToString, evaluateExpression, filter, filter, formatErrorString, formatString, getAttribute, getErrorsReport, getExpressionEvaluator, getJavaScriptUtils, getNearestForm, getNextId, getQualifiedBundleName, getScriptReporter, getUserLocale, hasErrors, isExpression, prepForRendering, registerAttribute, registerError, registerTagError, release, removeAttribute, renderAttribute, renderAttributes, reportErrors, rewriteName, setPageContext, updateExpression, write
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, 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, setParent
 

Field Detail

defaultLocale

protected static Locale defaultLocale
The default locale on the server.


bundle

protected String bundle
The message bundle where the error messages can be found. This defaults to org.apache.struts.action.Action.MESSAGES_KEY.


locale

protected String locale
The session attribute key for the locale. This defaults to org.apache.struts.action.Action.LOCALE_KEY.


value

protected String value
The value for getting the error key. This is either a keyname or an expression which gets the key name.

Constructor Detail

Error

public Error()
Method Detail

getTagName

public String getTagName()
Return the name of the Tag.

Specified by:
getTagName in class AbstractBaseTag

getBundle

public String getBundle()
Returns the name of the message bundle.

Returns:
the bundle's name

setBundle

public void setBundle(String bundle)
Set the name of the message bundle.

Parameters:
bundle - - the bundle name
Beadoc.attributedescription:
The message bundle where the error message can be found
Beadoc.attributesyntaxvalue:
string_bundle
Beadoc.databindable:
false

getLocale

public String getLocale()
Returns the name of the locale attribute.

Returns:
the locale attribute name

setLocale

public void setLocale(String locale)
Set the name of the locale attribute.

Parameters:
locale - - the locale attribute name
Beadoc.attributedescription:
The session attribute key for the locale
Beadoc.attributesyntaxvalue:
string_locale
Beadoc.databindable:
false

getValue

public String getValue()
Returns the value of the error key.

Returns:
the error key value

setValue

public void setValue(String value)
Set the value of the error key.

Parameters:
value - - the error key value
Beadoc.attributedescription:
The value for getting the error key
Beadoc.attributesyntaxvalue:
string_or_expression_value
Beadoc.databindable:
Read Only

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Render the specified error message if it can be found.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

localRelease

protected void localRelease()
Release any acquired resources.

Overrides:
localRelease in class AbstractBaseTag

BEA NetUI tags and APIs are included for backward compatibility only. For new applications, use the Beehive tags and APIs.