struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Brown <>
Subject Re: Struts2 Validation w/ModelDriven
Date Thu, 19 May 2011 17:45:20 GMT
Generally speaking, I don't advocate for client-side data validation
(javascript) since in most cases it's intended to be used instead of
server side validation, which is a Bad Thing.

In this case, however, perhaps some basic client-side validation would
be appropriate, just to prevent the user from submitting data that is
impossible to store in your model. Then you can let server validation
check the appropriateness of the data according to business rules,

 - Aaron

On Thu, May 19, 2011 at 1:16 PM, CRANFORD, CHRIS
<> wrote:
> Not that I am aware.  The paramsPrepareParamsStack to my knowledge
> handles validation at the very end; so by the time validation has
> happened; the model has already been prepared by the prepare() method.
> -----Original Message-----
> From: Eric Lentz []
> Sent: Thursday, May 19, 2011 11:58 AM
> To: Struts Users Mailing List
> Subject: Re: Struts2 Validation w/ModelDriven
>> So when this error condition is met and the user redirected back to
> the
> INPUT form; the
>> field where they had entered "xyz" is now the original default
>> initialized value.
> Can't you check the action error and not refresh the model when there is
> an error?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Aaron Brown :

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

View raw message