Module io.jstach.opt.spring.webmvc
Package io.jstach.opt.spring.webmvc
Class ViewResolvingHandlerInterceptor
java.lang.Object
io.jstach.opt.spring.webmvc.ViewResolvingHandlerInterceptor
- All Implemented Interfaces:
- WebMvcConfigurer,- HandlerInterceptor
public class ViewResolvingHandlerInterceptor
extends Object
implements HandlerInterceptor, WebMvcConfigurer
A 
HandlerInterceptor to automatically resolve a Controller method
 return value that is a JStache model into a JStachioModelView.- Author:
- dsyer
- 
Constructor SummaryConstructorsConstructorDescriptionViewResolvingHandlerInterceptor(JStachio jstachio) Spring will inject jstachio
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddInterceptors(InterceptorRegistry registry) voidpostHandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler, ModelAndView modelAndView) If the model contains an attribute that is aJStachemodel, in particular if it has been the result of aControllermethod, then it will be automatically converted into aJStachioModelView.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.HandlerInterceptorafterCompletion, preHandleMethods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigureraddArgumentResolvers, addCorsMappings, addFormatters, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
- 
Constructor Details- 
ViewResolvingHandlerInterceptorSpring will inject jstachio- Parameters:
- jstachio- jstachio instance found by spring.
 
 
- 
- 
Method Details- 
postHandlepublic void postHandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception If the model contains an attribute that is aJStachemodel, in particular if it has been the result of aControllermethod, then it will be automatically converted into aJStachioModelView.- Specified by:
- postHandlein interface- HandlerInterceptor
- Throws:
- Exception
 
- 
addInterceptors- Specified by:
- addInterceptorsin interface- WebMvcConfigurer
 
 
-