Class ResourcesConfiguration
java.lang.Object
com.foreach.across.modules.web.config.resources.ResourcesConfiguration
- All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Configuration
public class ResourcesConfiguration
extends Object
implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Configuration responsible for registering the static resource resolving with optional support
for caching and fixed version.
In case development mode is active, resources will not be cached and physical paths will be detected.
Customizing the default resource configuration can be done by overriding
DefaultResourceRegistrationConfigurer
and injecting it back into the module context under the same bean name (defaultResourceRegistrationConfigurer).
- Author:
- Arne Vandamme
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Configures theResourceUrlProvider
if versioning active. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addResourceHandlers
(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) void
reload
(ResourceHandlerRegistry resourceHandlerRegistry, org.springframework.context.ApplicationContext applicationContext, Map<String, org.springframework.web.cors.CorsConfiguration> corsConfigurations) Reloads the required resources configuration.org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
org.springframework.boot.web.servlet.FilterRegistrationBean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
addArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
-
Field Details
-
RESOURCE_URL_ENCODING_FILTER
- See Also:
-
-
Constructor Details
-
ResourcesConfiguration
public ResourcesConfiguration()
-
-
Method Details
-
addResourceHandlers
public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) - Specified by:
addResourceHandlers
in interfaceorg.springframework.web.servlet.config.annotation.WebMvcConfigurer
-
reload
public void reload(ResourceHandlerRegistry resourceHandlerRegistry, org.springframework.context.ApplicationContext applicationContext, Map<String, org.springframework.web.cors.CorsConfiguration> corsConfigurations) Reloads the required resources configuration.- Parameters:
resourceHandlerRegistry
- containing the registered resourcesapplicationContext
- triggering the reload
-
resourceHandlerMapping
@Bean public org.springframework.web.servlet.handler.SimpleUrlHandlerMapping resourceHandlerMapping() -
resourceUrlEncodingFilterRegistration
@Bean @ConditionalOnProperty(prefix="across.web.resources.versioning", value="enabled", matchIfMissing=true) @ConditionalOnConfigurableServletContext public org.springframework.boot.web.servlet.FilterRegistrationBean resourceUrlEncodingFilterRegistration()
-