diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-03-09 11:35:56 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-03-09 11:35:56 +0100 |
commit | 04a8a85a7092f460e30553394ae415ad9bed18ed (patch) | |
tree | 02a58fbb6f022ab926ca7d7ef2af14643d04b2d2 /id/server/moa-id-spring-initializer/src/main | |
parent | f9020f47b60bc1cff6c671461924ba606ce87853 (diff) | |
download | moa-id-spss-04a8a85a7092f460e30553394ae415ad9bed18ed.tar.gz moa-id-spss-04a8a85a7092f460e30553394ae415ad9bed18ed.tar.bz2 moa-id-spss-04a8a85a7092f460e30553394ae415ad9bed18ed.zip |
move basic applicationContext.xml to SpringInitialization modul
Diffstat (limited to 'id/server/moa-id-spring-initializer/src/main')
2 files changed, 39 insertions, 3 deletions
diff --git a/id/server/moa-id-spring-initializer/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthSpringInitializer.java b/id/server/moa-id-spring-initializer/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthSpringInitializer.java index 75e076d84..cc5552e81 100644 --- a/id/server/moa-id-spring-initializer/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthSpringInitializer.java +++ b/id/server/moa-id-spring-initializer/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthSpringInitializer.java @@ -8,6 +8,7 @@ import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.support.GenericApplicationContext; +import org.springframework.core.io.ClassPathResource; import org.springframework.web.WebApplicationInitializer; import org.springframework.web.context.ContextLoaderListener; import org.springframework.web.context.request.RequestContextListener; @@ -36,7 +37,7 @@ public class MOAIDAuthSpringInitializer implements WebApplicationInitializer { public MOAIDAuthSpringInitializer() { this.rootServletContexts = null; this.servletContexts = new String[] { - "/WEB-INF/applicationContext.xml", + "/applicationContext.xml", }; this.activeProfiles = null; @@ -92,10 +93,14 @@ public class MOAIDAuthSpringInitializer implements WebApplicationInitializer { Logger.debug("Loading servlet config in "+ rootContext); if (servletContexts != null) { for (String servletContextString : servletContexts) { - xmlReader.loadBeanDefinitions(new ServletContextResource( - servletContext, servletContextString)); + xmlReader.loadBeanDefinitions(new ClassPathResource( + servletContextString, + MOAIDAuthSpringInitializer.class)); } } + + + Logger.debug("Refreshing context "+ rootContext); rootContext.refresh(); diff --git a/id/server/moa-id-spring-initializer/src/main/resources/applicationContext.xml b/id/server/moa-id-spring-initializer/src/main/resources/applicationContext.xml new file mode 100644 index 000000000..42325314c --- /dev/null +++ b/id/server/moa-id-spring-initializer/src/main/resources/applicationContext.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xmlns:mvc="http://www.springframework.org/schema/mvc" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context + http://www.springframework.org/schema/context/spring-context.xsd + http://www.springframework.org/schema/mvc + http://www.springframework.org/schema/mvc/spring-mvc.xsd + http://www.springframework.org/schema/tx + http://www.springframework.org/schema/tx/spring-tx.xsd + " +> + + <context:annotation-config /> + <mvc:annotation-driven /> + + <context:component-scan base-package="at.gv.egovernment.moa.id.auth.frontend" /> + + <!-- <mvc:default-servlet-handler/> --> + + <mvc:interceptors> + <bean class="at.gv.egovernment.moa.id.auth.servlet.interceptor.WebFrontEndSecurityInterceptor" /> + <bean class="at.gv.egovernment.moa.id.auth.servlet.interceptor.UniqueSessionIdentifierInterceptor" /> + </mvc:interceptors> + + +</beans> |