Commit 77d97e76 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge commit '38458e9b' into 563-spring-security-frontend

parents bd6d1e03 38458e9b
rootLogger.level = INFO
appenders = console
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d %5p [%t] (%F:%L) - %m%n
rootLogger.appenderRefs = console
rootLogger.appenderRef.console.ref = STDOUT
logger.minerva.name = lcsb
logger.minerva.level = debug
logger.minerva-persist.name = lcsb.mapviewer.persist.DbUtils
logger.minerva-persist.level = info
logger.minerva-cache.name = lcsb.mapviewer.annotation.cache
logger.minerva-cache.level = info
logger.minerva-comparator.name = lcsb.mapviewer.common.Comparator
logger.minerva-comparator.level = info
logger.minerva-model.name = lcsb.mapviewer.model
logger.minerva-model.level = info
logger.springframework.name = org.springframework
logger.springframework.level = warn
logger.hibernate.name = org.hibernate
logger.hibernate.level = warn
......@@ -5,23 +5,13 @@ import lcsb.mapviewer.api.SpringRestApiConfig;
import lcsb.mapviewer.common.Configuration;
import lcsb.mapviewer.persist.SpringPersistConfig;
import lcsb.mapviewer.services.SpringServiceConfig;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.logging.log4j.core.LoggerContext;
import org.springframework.security.web.session.HttpSessionEventPublisher;
import org.springframework.web.context.ContextLoaderListener;
import org.springframework.web.context.request.RequestContextListener;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
import javax.servlet.*;
import java.net.URL;
import java.util.EnumSet;
public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
private Logger logger = LogManager.getLogger(WebAppInitializer.class);
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[] {
......@@ -29,15 +19,14 @@ public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServlet
SpringPersistConfig.class,
SpringAnnotationConfig.class,
SpringServiceConfig.class,
SpringRestApiConfig.class
SpringRestApiConfig.class,
SpringWebConfig.class
};
}
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class[] {
SpringWebConfig.class
};
return new Class[] {};
}
@Override
......@@ -47,7 +36,6 @@ public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServlet
@Override
public void onStartup(ServletContext container) throws ServletException {
// FIXME: Does this work? Do we need it?
assert container.setInitParameter("com.sun.faces.enableMissingResourceLibraryDetection", "true");
assert container.setInitParameter("primefaces.THEME", "home");
assert container.setInitParameter("javax.faces.FACELETS_BUFFER_SIZE", "65535");
......@@ -57,19 +45,6 @@ public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServlet
assert container.setInitParameter("javax.faces.DEFAULT_SUFFIX", ".xhtml");
assert container.setInitParameter("javax.faces.FACELETS_SKIP_COMMENTS", "true");
// FIXME: Why does this not work?
// assert container.setInitParameter("log4jConfigLocation", "/WEB-INF/resources/log4j2.properties");
// Workaround for above
String file = "/WEB-INF/resources/log4j2.properties";
try {
URL configStream = container.getResource(file);
LoggerContext context = (org.apache.logging.log4j.core.LoggerContext) org.apache.logging.log4j.LogManager.getContext(false);
context.setConfigLocation(configStream.toURI());
} catch (Exception e) {
logger.error("Problem with loading log4j configuration: " + file);
}
SessionCookieConfig cookieConfig = container.getSessionCookieConfig();
cookieConfig.setName(Configuration.AUTH_TOKEN);
cookieConfig.setHttpOnly(false);
......
Markdown is supported
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