server/renkan-web/src/main/webapp/WEB-INF/applicationContext.xml
changeset 316 242510015401
parent 315 8c85ab4cf3aa
child 317 2b30c5426f1e
equal deleted inserted replaced
315:8c85ab4cf3aa 316:242510015401
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <beans xmlns="http://www.springframework.org/schema/beans"
       
     3 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       
     4 	xmlns:context="http://www.springframework.org/schema/context"
       
     5 	xmlns:util="http://www.springframework.org/schema/util"
       
     6 	xmlns:mvc="http://www.springframework.org/schema/mvc"
       
     7 	xsi:schemaLocation="
       
     8 	        http://www.springframework.org/schema/beans
       
     9 	   		http://www.springframework.org/schema/beans/spring-beans.xsd
       
    10 	   		http://www.springframework.org/schema/context
       
    11 	   		http://www.springframework.org/schema/context/spring-context.xsd
       
    12 	   		http://www.springframework.org/schema/util
       
    13 	   		http://www.springframework.org/schema/util/spring-util.xsd
       
    14 	   		http://www.springframework.org/schema/mvc
       
    15             http://www.springframework.org/schema/mvc/spring-mvc.xsd"
       
    16 >
       
    17 
       
    18     <!-- Activates various annotations to be detected in bean classes -->
       
    19     <context:annotation-config />
       
    20     <mvc:annotation-driven />
       
    21 
       
    22     <util:properties id="propsLocations">
       
    23         <prop key="servletContextProps">WEB-INF/renkan.properties</prop>
       
    24         <prop key="classpathProps">classpath:renkan_run.properties</prop>
       
    25     </util:properties>
       
    26 
       
    27 	<!--context:property-placeholder  order="1000" ignore-unresolvable="true" ignore-resource-not-found="false" location="${propsLocations.servletContextProps}"/>	
       
    28 	<context:property-placeholder  order="1" ignore-unresolvable="true" ignore-resource-not-found="true" location="${propsLocations.classpathProps}"/-->
       
    29     <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
       
    30         <property name="order" value="1000"/>
       
    31         <property name="location" value="#{propsLocations.servletContextProps}"/>
       
    32         <property name="ignoreUnresolvablePlaceholders" value="true"/>
       
    33         <property name="IgnoreResourceNotFound" value="false"/>
       
    34     </bean> 
       
    35     <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
       
    36         <property name="order" value="1"/>
       
    37         <property name="location" value="#{propsLocations.classpathProps}"/>
       
    38         <property name="ignoreUnresolvablePlaceholders" value="true"/>
       
    39         <property name="IgnoreResourceNotFound" value="true"/>
       
    40     </bean> 
       
    41 		
       
    42 	<bean id="renkanProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
       
    43 	    <property name="IgnoreResourceNotFound" value="true"/>
       
    44         <property name="locations">
       
    45             <list>
       
    46                 <value>#{propsLocations.servletContextProps}</value>
       
    47                 <value>#{propsLocations.classpathProps}</value>
       
    48             </list>
       
    49         </property>
       
    50         <property name="fileEncoding" value="UTF-8"/>
       
    51     </bean>
       
    52 	
       
    53 	<!-- Configures the annotation-driven Spring MVC Controller programming model.
       
    54 	Note that, with Spring 3.0, this tag works in Servlet MVC only!  -->
       
    55 	
       
    56     <!-- Loads MongoDB configuraton -->
       
    57     <import resource="mongo-config.xml"/>
       
    58     <import resource="spring-security.xml"/>
       
    59 
       
    60     <bean id="springConfigurer"
       
    61         class="org.iri_research.renkan.coweb.SpringConfigurer"
       
    62         factory-method="getInstance" />
       
    63 
       
    64     <bean class="org.iri_research.renkan.RenkanProperties"
       
    65         factory-method="getInstance" />
       
    66 
       
    67 
       
    68     <!-- Scans the classpath for annotated components that will be auto-registered as Spring beans.
       
    69      For example @Controller and @Service. Make sure to set the correct base-package-->
       
    70     <context:component-scan base-package="org.iri_research.renkan.models" />
       
    71     <context:component-scan base-package="org.iri_research.renkan.rest" />
       
    72     <context:component-scan base-package="org.iri_research.renkan.coweb" />
       
    73     <context:component-scan base-package="org.iri_research.renkan.management" />
       
    74     
       
    75     <!--mvc:annotation-driven>
       
    76         <mvc:argument-resolvers>
       
    77             <bean class="org.springframework.data.web.PageableArgumentResolver">
       
    78                 <property name="fallbackPagable">
       
    79                     <bean class="org.springframework.data.domain.PageRequest">
       
    80                         <constructor-arg type="int" value="1"/>
       
    81                         <constructor-arg type="int" value="${renkan.pagination.size}"/>
       
    82                     </bean>
       
    83                 </property>
       
    84             </bean>
       
    85         </mvc:argument-resolvers>
       
    86     </mvc:annotation-driven-->
       
    87     
       
    88     <bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource">
       
    89         <property name="basenames">
       
    90             <list>
       
    91                 <value>WEB-INF/i18n/messages</value>
       
    92                 <value>classpath:org/springframework/security/messages</value>
       
    93             </list>
       
    94         </property>
       
    95         <property name="defaultEncoding" value="UTF-8"/>
       
    96         <property name="fallbackToSystemLocale" value="true" />
       
    97     </bean>
       
    98 
       
    99 </beans>