You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by j alex <st...@gmail.com> on 2007/08/08 15:15:50 UTC

S2 : Parameterized error messages

Hi,

Is there a way to customize the error message with multiple keys provided
from the resource bundle, using the XML/annotation approach ?

In S1, we could do :

            <field property="primaryApplicant.firstName" depends="required">
                <arg0 key="error.pleaseenter" />
                <arg1 key="error.firstapplicantName.required" />
            </field>

In S2 ; we use <message> to denote the error message ; but to what level can
we customize it? ; can it be partially constant and varying?

This could be useful if we use Visitor field validation, reuse the domain
model for different actions and want the message to be different when
invoked  by each action or if the model is used in different instances
(which i'm yet  to figure out!)

Thanks,
Joseph