4 Replies Latest reply on Jan 24, 2013 8:35 AM by matlach

    resteasy validation question

    matlach

      Hello everyone,

       

      I'm currently facing an issue with the usage of the validation in rest service.

       

      Here's my case :

       

      @Path("/")
      @Singleton
      @ConcurrencyManagement(ConcurrencyManagementType.BEAN)
      @SecurityDomain("MySecurityDomain")
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      public class MyService
      {
      
          @Path("/testvalidation/{id}")
          @GET
          @ValidateRequest
          public Response testValidation(@PathParam("id") @Min(value=1) int id)
          {
              return Response.ok().build();
          }
      
      }
      
      

       

      That done, when going to /testvalidation/0 I'm expecting to get an IllegalArgumentException as 0 < 1.

      Though, nothing happen, like if the annotation has no impact at all.

       

      Do the usage of @ValidateRequest or any @javax.validation.constraints.... require a specific setup to work ? anything in standalone.xml ? beans.xml ? jboss-deployment-structure.xml ?

       

      I'm deploying this on jboss as 7.1.2.Final and my service is bundled into a .jar inside an .ear.

       

      Anyone ?

       

      Big thanks,