Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
The Expression validator adds any errors it finds to the ActionErrors collection. This causes problems when you're using the validator at the field level, as follows :
<field name="name">
<field-validator type="expression">
<param name="expression">name.length() >= 1 && name.length() <= 5</param>
<message>Name length must be between than 1 and 5 characters.</message> </field-validator>
</field>
Since the error is in the ActionErrors collection the default WebWork2 ui controls won't display the error message next to the control like they do when using other validator types.
Ideally the errors collection that the message is added to would be configurable (perhaps for all tags).