我升级到春天3.1.1.RELEASE,现在我得到以下方法例外:
@RequestMapping(method = RequestMethod.POST, params = "_finish")
public ModelAndView doPostFinish(@PathVariable("runEnvironmentName") RunEnvironment pEnvironment, @ModelAttribute("command") JobSpecNewCommand pCommand, BindingResult pErrors)
{
...
}
抛出以下异常:
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) ...
正如你所看到的方法签名是符合市场预期。 该BindingResult参数模型属性后声明。
在同一类中的以下方法声明:
@ModelAttribute("otherJobSpecs")
public List<JobReference> modelOtherJobSpecs(@PathVariable("runEnvironmentName") RunEnvironment pEnvironment, @ModelAttribute("command") JobSpecNewCommand pCommand)
{
...
}
当我从类中删除的方法,一切正常。
有任何想法吗?