*
* @throws JspException
*/
@Override
public int doStartTag() throws JspException {
Errors errors = getErrors(this.pageContext);
if ((errors == null) || errors.isEmpty()) {
return EVAL_BODY_INCLUDE;
}
StringBuffer buffer = new StringBuffer();
Locale locale = HTMLHelpers.getLocale(this.pageContext,this.localeKey);
ResourceBundle bundle = ResourceLocator.getBundle(locale);
addElement(bundle, locale, buffer, Globals.ERRORS_HEADER, true);
for (Error errs : errors.get(this.errorKey)) {
addElement(bundle, locale, buffer, Globals.ERRORS_PREFIX, false);
buffer.append(errs.getMessage(locale));
addElement(bundle, locale, buffer, Globals.ERRORS_SUFFIX, false);
buffer.append("\n"); //$NON-NLS-1$
}