Commit ce7694fc authored by Matija Obreza's avatar Matija Obreza
Browse files

GZIP: Enable gzip filter

parent 2050c5b7
......@@ -34,6 +34,7 @@ import org.springframework.web.filter.DelegatingFilterProxy;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import org.tuckey.web.filters.urlrewrite.UrlRewriteFilter;
import org.tuckey.web.filters.urlrewrite.gzip.GzipFilter;
//import com.hazelcast.web.SessionListener;
......@@ -73,9 +74,13 @@ public class MvcContextInitializer extends AbstractAnnotationConfigDispatcherSer
}
};
// Encoding filter configuration
final CharacterEncodingFilter utf8Filter = new CharacterEncodingFilter("UTF-8", true, true);
// Gzip filter
final GzipFilter gzipFilter = new GzipFilter();
final DelegatingFilterProxy springSecurity = new DelegatingFilterProxy("springSecurityFilterChain");
springSecurity.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
......@@ -84,6 +89,8 @@ public class MvcContextInitializer extends AbstractAnnotationConfigDispatcherSer
urlRewriteFilter,
// Enforce UTF-8
utf8Filter,
// GZIP
gzipFilter,
// Security
springSecurity,
// Sitemesh
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment