You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Will Smith <bu...@gmail.com> on 2007/05/28 08:50:59 UTC

[S2] paramsPrepareParamsStack and validation

I don't quite understand how the validation is handled when using the
paramsPrepareParamsStack.

I have an action with a view() method that will be called via a get request
specifying a blog id (blog.id) which should be numeric. This is working, but
I want to make sure that if someone passed in an invalid value like a string
that a lookup won't be attempted, and the user will be redirected.

Where I'm getting confused is where exactly I should have this validation.
I've gotten the xml style validation working for form submissions, but will
this work even with get requests? I can always put it in the action's
method, but is that what should really be done when we have a validation
framework available? And I also found that if I disable validating the
blog.id that I still get redirected to an input page when there should be no
validation happening. Does this stack include some validation that I'm not
aware of?

Thanks,
Will