Skip to content

Instantly share code, notes, and snippets.

@krams915
Created December 2, 2012 08:14

Revisions

  1. krams915 revised this gist Dec 2, 2012. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion applicationContext.xml
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,7 @@
    Note that, with Spring 3.0, this tag works in Servlet MVC only! -->
    <mvc:annotation-driven />

    <!-- Maps resources path to webapp/resources -->
    <mvc:resources mapping="/resources/**" location="/resources/" />

    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"
    @@ -38,4 +39,4 @@
    <bean id="deployProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"
    p:location="/WEB-INF/spring.properties" />

    </beans>
    </beans>
  2. krams915 created this gist Dec 2, 2012.
    41 changes: 41 additions & 0 deletions applicationContext.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    <?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:p="http://www.springframework.org/schema/p"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.1.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">

    <context:property-placeholder properties-ref="deployProperties" />

    <!-- Activates various annotations to be detected in bean classes -->
    <context:annotation-config />

    <!-- Scans the classpath for annotated components that will be auto-registered as Spring beans.
    For example @Controller and @Service. Make sure to set the correct base-package -->
    <context:component-scan base-package="org.krams" />

    <!-- Configures the annotation-driven Spring MVC Controller programming model.
    Note that, with Spring 3.0, this tag works in Servlet MVC only! -->
    <mvc:annotation-driven />

    <mvc:resources mapping="/resources/**" location="/resources/" />

    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"
    p:basename="messages" />

    <!-- Imports logging configuration -->
    <import resource="trace-context.xml"/>

    <!-- Imports datasource configuration -->
    <import resource="spring-data.xml"/>

    <bean id="deployProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"
    p:location="/WEB-INF/spring.properties" />

    </beans>