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

Session timeout 6 hours

parent 737b5030
......@@ -35,7 +35,7 @@ import org.springframework.web.servlet.DispatcherServlet;
public class WebAppInitializer implements WebApplicationInitializer {
private static final int SESSION_TIMEOUT = 30;
private static final int SESSION_TIMEOUT = 60 * 60 * 6;
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
......@@ -46,7 +46,7 @@ public class WebAppInitializer implements WebApplicationInitializer {
servletContext.addListener(new ContextLoaderListener(rootContext));
servletContext.addListener(new org.genesys2.server.config.SessionListener(SESSION_TIMEOUT));
// servletContext.setInitParameter("contextConfigLocation", "classpath:spring/application-context.xml");
// servletContext.setInitParameter("contextConfigLocation", "classpath:spring/application-context.xml");
servletContext.setInitParameter("defaultHtmlEscape", "true");
servletContext.setSessionTrackingModes(EnumSet.of(SessionTrackingMode.COOKIE));
......@@ -61,7 +61,7 @@ public class WebAppInitializer implements WebApplicationInitializer {
}
private void registerServlets(ServletContext servletContext, AnnotationConfigWebApplicationContext appContext) {
//Dispatcher servlet configuration
// Dispatcher servlet configuration
DispatcherServlet dispatcher = new DispatcherServlet(appContext);
dispatcher.setThrowExceptionIfNoHandlerFound(true);
......@@ -71,7 +71,7 @@ public class WebAppInitializer implements WebApplicationInitializer {
dispatcherServlet.setLoadOnStartup(1);
dispatcherServlet.addMapping("/");
//Default Jetty servlet configuration
// Default Jetty servlet configuration
ServletRegistration defaultServlet = servletContext.getServletRegistration("default");
defaultServlet.setInitParameter("dirAllowed", "false");
......@@ -88,17 +88,17 @@ public class WebAppInitializer implements WebApplicationInitializer {
}
private void registerFilters(ServletContext servletContext, AnnotationConfigWebApplicationContext appContext) {
//UrlRewrite filter configuration
// UrlRewrite filter configuration
FilterRegistration.Dynamic urlRewriteFilter = servletContext
.addFilter("urlRewriteFilter", "org.tuckey.web.filters.urlrewrite.UrlRewriteFilter");
urlRewriteFilter.setInitParameter("confReloadCheckInterval", "10");
// urlRewriteFilter.setInitParameter("logLevel", "sysout:DEBUG");
// urlRewriteFilter.setInitParameter("logLevel", "sysout:DEBUG");
urlRewriteFilter.addMappingForUrlPatterns(
EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, "/*");
//Encoding filter configuration
// Encoding filter configuration
FilterRegistration.Dynamic encodingFilter = servletContext
.addFilter("encodingFilter", "org.springframework.web.filter.CharacterEncodingFilter");
......@@ -107,7 +107,7 @@ public class WebAppInitializer implements WebApplicationInitializer {
encodingFilter.addMappingForUrlPatterns(null, false, "/*");
//Configuration of cross origin filter for web REST API clients
// Configuration of cross origin filter for web REST API clients
FilterRegistration.Dynamic crossOriginFilter = servletContext
.addFilter("cross-origin", "org.eclipse.jetty.servlets.CrossOriginFilter");
......@@ -115,14 +115,14 @@ public class WebAppInitializer implements WebApplicationInitializer {
crossOriginFilter.setInitParameter("allowCredentials", "true");
crossOriginFilter.setInitParameter("allowedMethods", "GET,POST,PUT,DELETE");
crossOriginFilter.setInitParameter("allowedHeaders", "*");
//Do not chain preflight request to application
// Do not chain preflight request to application
crossOriginFilter.setInitParameter("chainPreflight", "false");
crossOriginFilter.addMappingForUrlPatterns(null, false, "/oauth/token");
crossOriginFilter.addMappingForUrlPatterns(null, false, "/api/*");
crossOriginFilter.addMappingForUrlPatterns(null, false, "/webapi/*");
//Hazelcast web filter configuration
// Hazelcast web filter configuration
FilterRegistration.Dynamic hazelcastWebFilter = servletContext
.addFilter("hazelcastWebFilter", "org.springframework.web.filter.DelegatingFilterProxy");
......@@ -131,14 +131,14 @@ public class WebAppInitializer implements WebApplicationInitializer {
hazelcastWebFilter.addMappingForUrlPatterns(
EnumSet.of(DispatcherType.FORWARD, DispatcherType.INCLUDE, DispatcherType.REQUEST), false, "/*");
//Filter chain proxy configuration
// Filter chain proxy configuration
FilterRegistration.Dynamic filterChainProxy = servletContext
.addFilter("org.springframework.security.filterChainProxy",
"org.springframework.web.filter.DelegatingFilterProxy");
filterChainProxy.addMappingForUrlPatterns(null, false, "/*");
//Locale URL filter configuration
// Locale URL filter configuration
FilterRegistration.Dynamic localeURLFilter = servletContext
.addFilter("localeURLFilter", "org.genesys2.server.servlet.filter.LocaleURLFilter");
......@@ -148,26 +148,26 @@ public class WebAppInitializer implements WebApplicationInitializer {
localeURLFilter.addMappingForUrlPatterns(null, false, "/*");
//EnvVar filter configuration
//Adds variables to all requests
// EnvVar filter configuration
// Adds variables to all requests
FilterRegistration.Dynamic envVarFilter = servletContext
.addFilter("envVarFilter", "org.springframework.web.filter.DelegatingFilterProxy");
envVarFilter.addMappingForUrlPatterns(null, false, "/*");
//Genesys Web API Filter configuration
// Genesys Web API Filter configuration
FilterRegistration.Dynamic webApiFilter = servletContext
.addFilter("webApiFilter", "org.springframework.web.filter.DelegatingFilterProxy");
webApiFilter.addMappingForUrlPatterns(null, false, "/webapi/*");
//Sitemesh filter configuration
// Sitemesh filter configuration
FilterRegistration.Dynamic sitemeshFilter = servletContext
.addFilter("sitemesh", "org.sitemesh.config.ConfigurableSiteMeshFilter");
sitemeshFilter.addMappingForUrlPatterns(null, false, "/*");
//New GUI filter configuration
// New GUI filter configuration
FilterRegistration.Dynamic newGUIFilter = servletContext
.addFilter("newGUIFilter", "org.genesys2.server.servlet.filter.NewGUIFilter");
......
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