Is it possible to validate my input parameter using @Valid?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it possible to validate my input parameter using @Valid?

Dave Alvarado
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to validate my input parameter using @Valid?

david@butterdev.com
Good question Dave.  I haven't researched this but my initial thought it
that you cannot do this with the @Valid annotation.  However nothing is
stopping you from manually calling a validator and returning the
results.

On 2014-03-06 09:21, Dave Alvarado wrote:

> Hi,
>
> I’m using DWR 3.0.0-rc2 and Spring 3.1.1.RELEASE. I was wondering if
> its possible to validate my @DataTransferObject input object using the
> Spring style “@Valid” (javax.validation.Valid) annotation. My
> specific question is, if this is possible and I set up my remote call
> like so …
>
>  @RemoteMethod
>
>  @Override
>
>  public String myRemoteMethod(@Valid final MyDto request)
>
>  {
>
> how do I test to see if the input object (request) is valid and then
> throw a corresponding set of errors back to the client?
>
> Thanks, - Dave