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 | |
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
-rw-r--r-- | id/server/moa-id-spring-initializer/src/main/java/at/gv/egovernment/moa/id/auth/MOAIDAuthSpringInitializer.java | 11 | ||||
-rw-r--r-- | id/server/moa-id-spring-initializer/src/main/resources/applicationContext.xml (renamed from id/server/auth/src/main/webapp/WEB-INF/applicationContext.xml) | 60 |
2 files changed, 38 insertions, 33 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/auth/src/main/webapp/WEB-INF/applicationContext.xml b/id/server/moa-id-spring-initializer/src/main/resources/applicationContext.xml index f3b133585..42325314c 100644 --- a/id/server/auth/src/main/webapp/WEB-INF/applicationContext.xml +++ b/id/server/moa-id-spring-initializer/src/main/resources/applicationContext.xml @@ -1,31 +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
+<?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>
+ 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> |