Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring MVC 3.1 exception : An Errors/BindingResult argument is expected to be immediately after the model attribute argument
    primarykey
    data
    text
    <p>I upgraded to Spring 3.1.1.RELEASE, and now I'm getting an exception on the following method: <br/></p> <p></p> <pre><code>@RequestMapping(method = RequestMethod.POST, params = "_finish") public ModelAndView doPostFinish(@PathVariable("runEnvironmentName") RunEnvironment pEnvironment, @ModelAttribute("command") JobSpecNewCommand pCommand, BindingResult pErrors) { ... } </code></pre> <p></p> <p>Throws the following exception: <br/></p> <pre> java.lang.IllegalStateException: An Errors/BindingResult argument is expected to be immediately after the model attribute argument in the controller method signature: java.lang.IllegalStateException: An Errors/BindingResult argument is expected to be immediately after the model attribute argument in the controller method signature: public org.springframework.web.servlet.ModelAndView de.wwag.infra.oocsd.projectAdmin.fe.natures.hudson.jobspecs.RunEnvJobSpecNewController.doPostFinish(de.wwag.infra.oocsd.projectAdmin.common.domain.RunEnvironment,de.wwag.infra.oocsd.projectAdmin.fe.natures.hudson.jobspecs.JobSpecNewCommand,org.springframework.validation.BindingResult) at org.springframework.web.method.annotation.ErrorsMethodArgumentResolver.resolveArgument(ErrorsMethodArgumentResolver.java:62) ... </pre> <p><br/> As you can see the method signature is as expected. The BindingResult argument is declared after the model attribute. <br/></p> <p>In the same class the following method is declared: <br/></p> <p></p> <pre><code>@ModelAttribute("otherJobSpecs") public List&lt;JobReference&gt; modelOtherJobSpecs(@PathVariable("runEnvironmentName") RunEnvironment pEnvironment, @ModelAttribute("command") JobSpecNewCommand pCommand) { ... } </code></pre> <p></p> <p>When I remove the method from the class, everything works as expected.</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload