Spring Framework
  1. Spring Framework
  2. SPR-6709

JSR-303 @Valid validation is not invoked for @RequestBody controller method arguments

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 3.0 GA
    • Fix Version/s: 3.1 M2
    • Component/s: Web
    • Labels:
      None

      Description

      If an argument to a Spring MVC Controller method is annotated with both the @RequestBody and @Valid annotations, the argument should be passed to the validation framework after being populated, but the validation is not invoked.

      More details and an example are included in the forum thread.

        Activity

        Hide
        Scott Frederick added a comment -

        I don't see anything to indicate that the combination of @Valid and @RequestBody is the source of the ZipException, but there isn't very much information here to go on. I suggest posting your problem, with as much detail as possible, to the Web section of the Spring Forum: http://forum.springsource.org/forumdisplay.php?25-Web.

        Show
        Scott Frederick added a comment - I don't see anything to indicate that the combination of @Valid and @RequestBody is the source of the ZipException, but there isn't very much information here to go on. I suggest posting your problem, with as much detail as possible, to the Web section of the Spring Forum: http://forum.springsource.org/forumdisplay.php?25-Web .
        Hide
        Puneet Pandey added a comment -

        Scott: I too couldn't see any relation between Validation annotations and ZipException. Unfortunately, however, I was getting the exception only when I was changing the Spring version. I could process a little further but couldn't get the issue resolved completely. Will post the issue in Springsource forum too. Thanks!

        Show
        Puneet Pandey added a comment - Scott: I too couldn't see any relation between Validation annotations and ZipException. Unfortunately, however, I was getting the exception only when I was changing the Spring version. I could process a little further but couldn't get the issue resolved completely. Will post the issue in Springsource forum too. Thanks!
        Show
        Puneet Pandey added a comment - Hi Scott: Posted the issue to the SpringSource: http://forum.springsource.org/showthread.php?135923-Spring3-MVC-annotation-driven-Rest-Services-in-OSGi-environment-bean-validation-issue&p=441701#post441701
        Hide
        Oliver Gierke added a comment -

        An exception like this usually indicates corrupted JAR files. Have you tried purging your local Maven repo (or equaivalent) and re-grabbing the binaries?

        Show
        Oliver Gierke added a comment - An exception like this usually indicates corrupted JAR files. Have you tried purging your local Maven repo (or equaivalent) and re-grabbing the binaries?
        Hide
        Puneet Pandey added a comment -

        Oliver: You are correct, it was actually a case of corrupted jar. I have actually progressed and deployed the code to the Virgo Server. But, still could not get it to work. Have posted the issue to the SpringSource. Please have a look into it and suggest.

        Link:

        http://forum.springsource.org/showthread.php?135923-Spring3-MVC-annotation-driven-Rest-Services-in-OSGi-environment-bean-validation-issue&p=441701#post441701

        Show
        Puneet Pandey added a comment - Oliver: You are correct, it was actually a case of corrupted jar. I have actually progressed and deployed the code to the Virgo Server. But, still could not get it to work. Have posted the issue to the SpringSource. Please have a look into it and suggest. Link: http://forum.springsource.org/showthread.php?135923-Spring3-MVC-annotation-driven-Rest-Services-in-OSGi-environment-bean-validation-issue&p=441701#post441701

          People

          • Assignee:
            Rossen Stoyanchev
            Reporter:
            Scott Frederick
            Last updater:
            Puneet Pandey
          • Votes:
            26 Vote for this issue
            Watchers:
            30 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 4 weeks, 1 day ago