Hi Neg,
> PM>     if (!validA(fieldA))
> PM>     {
> PM>         errors.add("fieldA", new
ActionError("classX.fieldA.notValid"));
> PM>     }
> PM>     ...
> PM>     return result;
> PM> }
>
> How would it be written to browser?
> As "fieldA" - <error message from locale package> ?
> Or i18n can be applied to field name too?

"fieldA" is a constant key to map errors in the ActionErrors collection, so
you can decide what to do with them.
"classX.fieldA.notValid" is a key to find the appropriate error message in
your resource file (i18n applied).

There's no way for now to render the error to the browser. What is missing
is something like <form:error name="fieldA" /> that would display the
associated error message on your form. You can try to write it and propose
your code for 1.0 inclusion...

Pierre Métras


Reply via email to