You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by robin bajaj <ro...@gmail.com> on 2006/10/31 23:21:46 UTC
how to generate generic errors using Struts validation framework
Hi Everyone,
I am using Struts 1.2 validation framework where I am using the
following elements to mention validation rules for specific action
properties.
<form name="navigatePatientForm">
<field
property="<actionform-property-name>"
depends="required">
<arg0 key="<property-label-name-from-resourcebundle>"/>
</field>
But this only allows me to generate validation errors for specific
ActionForm property names.
I need to know how can I generate GLOBAL validation errors using the
validation.xml file. I know this can be done easily in ActionForm's java
code like:
errors.add(ActionErrors.GLOBAL_ERROR,new
ActionError("error.username.required")
);
Thanks for your help,
robin
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org