Class RestConfig

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

    @Configuration
    @ComponentScan
    public class RestConfig
    extends Object
    implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    Spring configuration for MVC-based REST service. This prepares needed XML/JSON/YAML message converters. It also drives the package scan for REST controllers under this package.
    • Constructor Detail

      • RestConfig

        public RestConfig()
    • Method Detail

      • configureContentNegotiation

        public void configureContentNegotiation​(@NotNull
                                                @NotNull org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer configurer)
        Registers content-types for path extension and request parameter usage. Not needed for header-based content negotiation and midPoint typically doesn't use this, but it doesn't hurt and may be handy for download URLs.

        See this tutorial for more about content negotiation.

        Specified by:
        configureContentNegotiation in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
      • extendMessageConverters

        public void extendMessageConverters​(List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
        All beans above will be first in the converter list and other Spring converters will be available as well. We want to add "catch-all" converter for cases like error output for any (even unsupported) content type.
        Specified by:
        extendMessageConverters in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer