Announcement Announcement Module
Collapse
No announcement yet.
How to catch Velocity errors? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to catch Velocity errors?

    Hello,
    While processing a template, if Velocity cannot resolve the view for a #include or #parse it throws a ResourceNotFoundException that cascades into a javax.servlet.ServletException. Is there any way to trap this error? The SimpleMappingExceptionResolver does not seem to be able to catch it.

    Thanks

  • #2
    ExceptionResolver is not consulted after view rendering begins. I don't think there's much you can do at this late stage - it's really a programming error. Unless you're expecting users to nominate template includes as part of normal application usage??

    The only place you can even trap this error is in a HandlerInterceptor's afterCompletion() method which fires after view rendering with or without exceptions being thrown. But it's way too late to do anything like issue a response.sendRedirect.

    Comment

    Working...
    X