Announcement Announcement Module
No announcement yet.
Validation in MultiActionControllers behaviour strange? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Validation in MultiActionControllers behaviour strange?

    What I wish to do is specify a list of validators for a method name. So I inject them into the multi action controller via the validator property.

    To my suprise, the framework invokes the validators before the controller method is executed. And when the form is invalid, the exception below gets thrown to the Jsp. Ideally it would detect errors and i could redirect it back to the view with the command bean and errors bean populated to make use of the form:errors tag. This is what i would expect to happen but whats with this exception?? Why is the closeNoCatch method being called?

    org.springframework.web.bind.ServletRequestBinding Exception: Errors binding onto object 'command'; nested exception is org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBinding Result: 1 errors
    Field error in object 'command' on field 'email1': rejected value [gfhghgj]; codes [defaultMessage.command.email1, 1,,defaultMessage]; arguments []; default message [null]
    org.springframework.web.bind.ServletRequestDataBin der.closeNoCatch( )
    org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.bind(MultiActionController.jav a:541)
    org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.invokeNamedMethod(MultiActionC
    org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.handleRequestInternal(MultiAct
    org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda
    org.springframework.web.servlet.DispatcherServlet. doDispatch(
    org.springframework.web.servlet.DispatcherServlet. doService(
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
    org.springframework.web.servlet.FrameworkServlet.d oPost(
    javax.servlet.http.HttpServlet.service(HttpServlet .java:647)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:729)

  • #2
    You ever get a solution to this? I'm having a similar problem.


    • #3
      i can help u to get rid of the exception
      the exception is because u have bind the object in JSP using either
      <spring:nested path=""> or simple by <spring:input path="">
      just remove the path attribute.
      u canot apply the validator as in SimpleFormControlre