Class EnableWebMvcConfiguration

java.lang.Object
com.foreach.across.modules.web.extensions.EnableWebMvcConfiguration
All Implemented Interfaces:
org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations

@ModuleConfiguration("AcrossContextPostProcessorModule") @Import(org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration.class) public class EnableWebMvcConfiguration extends Object implements org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations
Activates Web MVC support in the post processor module. Infrastructure created here will not be available except after refresh.

Requires configuration classes to be either injected in the post processor module as well, or to be exposed.

Since:
3.0.0
Author:
Arne Vandamme
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver
    Create custom layout supporting handler exception resolver.
    org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
    Create custom request mapping handler mapping that only matches on @Controller instead of anything with @RequestMapping.
    org.springframework.format.support.FormattingConversionService
    mvcConversionService(AcrossContextBeanRegistry beanRegistry, List<org.springframework.web.servlet.config.annotation.WebMvcConfigurer> configurers)
    Replace the ConversionService bean definition, ensure the earlier created service from AcrossWebModule is being used.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations

    getRequestMappingHandlerAdapter
  • Constructor Details

  • Method Details

    • getRequestMappingHandlerMapping

      public org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping getRequestMappingHandlerMapping()
      Create custom request mapping handler mapping that only matches on @Controller instead of anything with @RequestMapping.
      Specified by:
      getRequestMappingHandlerMapping in interface org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations
      Returns:
      mapping new instance
    • getExceptionHandlerExceptionResolver

      public org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver getExceptionHandlerExceptionResolver()
      Create custom layout supporting handler exception resolver.
      Specified by:
      getExceptionHandlerExceptionResolver in interface org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations
      Returns:
      exception resolver instance
    • mvcConversionService

      @Bean public org.springframework.format.support.FormattingConversionService mvcConversionService(AcrossContextBeanRegistry beanRegistry, List<org.springframework.web.servlet.config.annotation.WebMvcConfigurer> configurers)
      Replace the ConversionService bean definition, ensure the earlier created service from AcrossWebModule is being used.

      Manually iterate over the WebMvcConfigurer instances as the default MVC support no longer adds the formatter since we overruled the bean definition.

      Parameters:
      beanRegistry - to get the conversion service
      Returns:
      existing instance