Announcement Announcement Module
Collapse
No announcement yet.
Accessing BindException within a custom view Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Accessing BindException within a custom view

    I've implemented a custom view that extends the AbstractView class, and I need to be able to access the BindException from that view in cases where there are validation errors. (I'm implementing a Web service, so there's no form per se, in cases where there are validation errors I need to send back some XML that explains what went wrong.)

    The BindException is in the model passed to the renderMergedOutputModel() method, with the key "org.springframework.validation.BindException.MY_C OMMAND_NAME".

    Is there a canonical way to grab the errors from the model, or do I need to do something weird like iterate over the model and find the object that's an instance of BindException? I'm having trouble finding a way to derive the command name from inside my view to construct the full name of the key for the BindException.
Working...
X