*Assuming* ApplicationResources.properties contains
In the ApplicationResources.properties:
errors.email=<font color="red"><strong>invalid e-mail address.</strong></font>

If your key value isnt pointing to errors.email then it should be pointing to a bundle specification for your ApplicationResources file which contains that key <message-resources bundle="label.screen3.emailAddress" parameter="ApplicationResources"/>

/*Now specify the exact key parameter to reference in the bundle in your jsp*/
<bean:message bundle="label.screen3.emailAddress" key="errors.email"/>

HTH,
Martin-
----- Original Message ----- From: <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Friday, November 18, 2005 3:52 PM
Subject: RE: Is there an easy way to print error messages


Yeah, I do it this way:

In the ApplicationResources.properties:
errors.email=<font color="red"><strong>invalid e-mail address.</strong></font>

And in the jsp:
<tr>

<td width="200" align="right"><bean:message key="label.screen3.emailAddress"/>:</td>

<td><html:text property="emailAddress"/></td><td><html:errors property="emailAddress"/></td>

</tr>

On 11/18/05, Aladin Alaily <[EMAIL PROTECTED]> wrote:
Problem solved... must be Friday.

Aladin


> Hello,
>
> I am using struts 1.2.7 and am having trouble outputing error messages > for
> specific fields.
>
> If I have the following (in a form):
>
> <html:input property="name" />
>
> and in my action I do something like:
>
> messages.add("name", new ActionMessage("error.name.required"));
> super.saveErrors(request.getSession(), messages);
>
>
> Now, I would expect that the error message be outputted to the right of
> the textfield (<input..> Error message here), but it doesn't.
>
> Does anyone know if things have changed in 1.2.7... or am I missing
> something here?
>
> Thanks!
> Aladin
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to