Class DefaultResourceRegistrationConfigurer
java.lang.Object
com.foreach.across.modules.web.config.resources.DefaultResourceRegistrationConfigurer
Applies the caching and versioning configuration for the default module resources.
Supports the different properties specified in
ResourceConfigurationProperties
.
Replacing the default behavior can be done by injecting an extension in the same context.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Special implementation that does no link transforming inside css files. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
void
configure
(String resourceFolder, org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration registration) Apply the default configuration to aResourceHandlerRegistration
that configures a specific type of resource folder (eg. css, js).protected Integer
protected String
protected boolean
protected boolean
org.springframework.web.servlet.resource.VersionResourceResolver
-
Constructor Details
-
DefaultResourceRegistrationConfigurer
public DefaultResourceRegistrationConfigurer()
-
-
Method Details
-
configure
public void configure(String resourceFolder, org.springframework.web.servlet.config.annotation.ResourceHandlerRegistration registration) Apply the default configuration to aResourceHandlerRegistration
that configures a specific type of resource folder (eg. css, js).- Parameters:
resourceFolder
- nameregistration
- entry
-
getCachePeriod
- Returns:
- period to cache resources
-
getFixedVersion
- Returns:
- configured fixed version to use for versioning strategy
-
shouldApplyFixedVersion
protected boolean shouldApplyFixedVersion()- Returns:
- true if versioning is enabled
-
shouldApplyCaching
protected boolean shouldApplyCaching()- Returns:
- true if a cache period should be set
-
cacheResourceResolving
protected boolean cacheResourceResolving()- Returns:
- true if resource resolving itself should be cached
-
versionResourceResolver
@Bean @ConditionalOnProperty(prefix="across.web.resources.versioning", value="enabled", matchIfMissing=true) @ConditionalOnMissingBean(value=org.springframework.web.servlet.resource.VersionResourceResolver.class, search=CURRENT) public org.springframework.web.servlet.resource.VersionResourceResolver versionResourceResolver()
-