hi juraj

thanks for your responde. yes, in my action I have the following code:

ActionErrors errors = new ActionErrors();
...
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error_name));

Is it not right, like this?

Marcel


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 5:23 PM
To: [EMAIL PROTECTED]
Subject: AW: Does <html:errors> not work proper?


hi marcel,

did you have registered an error in your actionServlet?
you have to put something like : errors.add("test", new
ActionError("test.error"));
your Application Ressource describes the key: test.error=This is an error

in your jsp you can then output the error with:
<html:errors property="test" />

the way with validate values in the form bean, like yours, is similar.


juraj


-----Urspr�ngliche Nachricht-----
Von: Marcel Andres [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 10. September 2001 17:06
An: struts-user
Betreff: Does <html:errors> not work proper?


Hi there

Like most of you, I am using the <html:errors>-tag to show errors on the JSP
page. My problem is, that I don't get any message on the JSP page. I do the
following check before I return to the form:

if (!errors.empty()) {
        saveErrors(request, errors);
        return (new ActionForward(mapping.getInput()));
}

When I check the values, "errors.empty()" it is set to false, and the value
for "errors.size()" is 1.

On the JSP, I am using a template with header, main, and footer. In the
header I declared this:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

....

<!----- Handling the Errors ----->
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="18">
 <tr>
  <font class="error">
   <html:errors/>
  </font>
 </tr>
</table>


Any comments would be appreciated.

Marcel

Reply via email to