struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <>
Subject Re: ErrorStyleClass
Date Tue, 03 Jan 2006 22:58:26 GMT
For the errorStyleClass to be used there need to be a set of
"ActionMessages" stored under the appropriate key (i.e. Globals.ERROR_KEY)
and there needs to be a message for the field in error - i.e. in your case a
message associated with the "lastName" property.

If your returning an appropriate set of ActionMessages in your ActionForm's
validate method they'll automatically get stored under the right key and you
just need to make sure the property name for the specific message is set
correctly. If your not doing this then you need to say how you are

Also, when you say "it just has the styleClass" - do you mean it is
rendering <input type="text" class="login"> rather than <input type="text"


----- Original Message ----- 
From: "RathinaGanesh MeenakshiSundaram" <>
Sent: Tuesday, January 03, 2006 8:24 PM

I figured out the issue. I had a different version of struts in another app,
and somehow that was classloader was picking up that older version..
But, still after I get them right, the text field is not picking up the
errorStyleClass and just has the styleClass, even incase of error..!

Here is my peice of code..
 <html:text styleClass="login" property="lastName" maxlength="15" size="28"
styleId="lastname" errorStyleClass="loginERROR" />

Please let me know.

On 1/3/06, Niall Pemberton <> wrote:
> OK but a "setter" does exist for that property in the <html:text> tag in
> Struts 1.2.7 and Struts 1.2.8 so somethings wrong in your app somewhere.
> Niall

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message