You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by michael wimmer <m....@ecom-it.at> on 2003/03/19 15:47:48 UTC

error handling

Hi,

being pretty new to Sturts, I just finished a simple form with the
according FormBean and Action classes.

Now I face the problem, that I should display the error Text if an entry
is missing and change the style of the input field.

<html:errors property="..."/> works fine for displaying the error
message, but I was just wondering if there is a way to determine if
there is an error set for the property. e.g. storing the errortext in a
variable before displaying and changing the style of the field depending
if the variable is empty or not.

regards,

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: error handling

Posted by Simon Kelly <ke...@ipe.fzk.de>.
There is quite a collection of sources for this, using validator and the
.properties files.  Store the error messages in the .properties file and
then reference them in the returned form with errors.

I don't use jsps so I can't give you a working example, but there are a few
in the struts documentation somewhere.

Cheers

Simon

----- Original Message -----
From: "michael wimmer" <m....@ecom-it.at>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, March 19, 2003 3:47 PM
Subject: error handling


> Hi,
>
> being pretty new to Sturts, I just finished a simple form with the
> according FormBean and Action classes.
>
> Now I face the problem, that I should display the error Text if an entry
> is missing and change the style of the input field.
>
> <html:errors property="..."/> works fine for displaying the error
> message, but I was just wondering if there is a way to determine if
> there is an error set for the property. e.g. storing the errortext in a
> variable before displaying and changing the style of the field depending
> if the variable is empty or not.
>
> regards,
>
> Michael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org