From 8094d66534f47ed302d271da4dba1147fe6b2a3c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 6 Sep 2017 14:23:07 +0300 Subject: www: cleanup and fix configuration --- .../java/com/juick/www/configuration/WwwServletConfiguration.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java') diff --git a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java index 7a5de28c..cad8cfdb 100644 --- a/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java +++ b/juick-www/src/main/java/com/juick/www/configuration/WwwServletConfiguration.java @@ -29,8 +29,10 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; +import org.springframework.core.Ordered; import org.springframework.http.CacheControl; import org.springframework.web.servlet.ViewResolver; +import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.resource.PathResourceResolver; @@ -50,7 +52,7 @@ public class WwwServletConfiguration extends BaseWebConfiguration { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.setOrder(0); + registry.setOrder(Ordered.HIGHEST_PRECEDENCE); registry.addResourceHandler( "/scripts*.js*", "/style*.css*", @@ -65,6 +67,10 @@ public class WwwServletConfiguration extends BaseWebConfiguration { .addResourceLocations("/static/") .setCacheControl(CacheControl.maxAge(30, TimeUnit.DAYS).mustRevalidate().cachePublic()); } + @Override + public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { + configurer.enable(); + } @Inject private ServletContext servletContext; -- cgit v1.2.3