Interface ViewInterceptor

    • Method Detail

      • onRequest

        void onRequest​(javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse resp)
        Called when a HTTP request was sent to the view service. The request has not yet been processed.
        Parameters:
        req - HttpServletRequest to be handled
        resp - HttpServletResponse with the response
      • onViewHandlerInvocation

        void onViewHandlerInvocation​(ViewContext context,
                                     Object bean,
                                     Method method)
        Called when a ViewHandler is about to be invoked.
        Parameters:
        context - ViewContext passed to the view handler
        bean - Spring bean containing the view handler
        method - View handler method that will be invoked
      • onRendering

        String onRendering​(String template,
                           javax.servlet.http.HttpServletRequest req,
                           javax.servlet.http.HttpServletResponse resp)
        Called when a ViewHandler successfully processed the request and returned a template string that is now to be rendered. The interceptor can change the template name.
        Parameters:
        template - Template name returned by the view handler
        req - HttpServletRequest that was handled
        resp - HttpServletResponse with the response
        Returns:
        a different template name, or null for keeping the original template name
      • onErrorResponse

        boolean onErrorResponse​(ErrorResponseException ex,
                                javax.servlet.http.HttpServletRequest req,
                                javax.servlet.http.HttpServletResponse resp)
        Called when an ErrorResponseException occured. The interceptor is able to catch the error.
        Parameters:
        ex - ErrorResponseException that occured
        req - HttpServletRequest that led to this error
        resp - HttpServletResponse with the response
        Returns:
        true if the interceptor responded to the error. Other interceptors will not be invoked, and the HttpServletResponse is sent back. false if the error handling shall be continued.