struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Brown <aa...@thebrownproject.com>
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,
etc.

 - Aaron

On Thu, May 19, 2011 at 1:16 PM, CRANFORD, CHRIS
<Chris.Cranford@setech.com> 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 [mailto:Eric.Lentz@sherwin.com]
> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Aaron Brown : aaron@thebrownproject.com

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


Mime
View raw message