Class ViewSetupHandlerInterceptor

java.lang.Object
io.jstach.opt.spring.webmvc.ViewSetupHandlerInterceptor
All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer, org.springframework.web.servlet.HandlerInterceptor

public class ViewSetupHandlerInterceptor extends Object implements org.springframework.web.servlet.HandlerInterceptor, org.springframework.web.servlet.config.annotation.WebMvcConfigurer
A HandlerInterceptor that automatically applies all JStachioModelViewConfigurer instances to views before rendering. Also implements WebMvcConfigurer so that it registers itself when the servlet context starts.
Author:
dsyer
  • Constructor Summary

    Constructors
    Constructor
    Description
    ViewSetupHandlerInterceptor(org.springframework.context.ApplicationContext context)
    Injected context will be searched for JStachioModelViewConfigurer
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
     
    void
    postHandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView)
    If the modelAndView is a JStachioModelView then it will be configured with all of the found JStachioModelViewConfigurer in the application context.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.servlet.HandlerInterceptor

    afterCompletion, preHandle

    Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    addArgumentResolvers, addCorsMappings, addFormatters, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
  • Constructor Details

  • Method Details

    • postHandle

      public void postHandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView) throws Exception
      If the modelAndView is a JStachioModelView then it will be configured with all of the found JStachioModelViewConfigurer in the application context.
      Specified by:
      postHandle in interface org.springframework.web.servlet.HandlerInterceptor
      Throws:
      Exception
    • addInterceptors

      public void addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
      Specified by:
      addInterceptors in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer