Class StaticResourceConfiguration

  • All Implemented Interfaces:
    org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    @RootConfiguration
    public class StaticResourceConfiguration
    extends Object
    implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    Resource configuration to be able to serve Angular based apps from the Blueriq out-of-the-box installation and war applications
    Since:
    11.0
    Author:
    r.de.haard
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addResourceHandlers​(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)  
      void addViewControllers​(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
      Adds views for the root of and forwards the root of "/app/" to serve the index.html.
      • Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer

        addArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addReturnValueHandlers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
    • Constructor Detail

      • StaticResourceConfiguration

        public StaticResourceConfiguration()
    • Method Detail

      • addResourceHandlers

        public void addResourceHandlers​(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
        Specified by:
        addResourceHandlers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
      • addViewControllers

        public void addViewControllers​(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
        Adds views for the root of and forwards the root of "/app/" to serve the index.html. This is needed to enable routes in Angular and keep the browser refresh working when an angular app is provided as static resource
        Specified by:
        addViewControllers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer