server/src/main/webapp/WEB-INF/spring-servlet.xml
author ymh <ymh.work@gmail.com>
Mon, 14 Jan 2013 16:00:07 +0100
changeset 51 3247fccfbd3f
parent 47 267d67791e05
child 76 523f0647513e
permissions -rw-r--r--
update on renkan

<?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:p="http://www.springframework.org/schema/p"
    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-3.0.xsd
                        http://www.springframework.org/schema/context
                        http://www.springframework.org/schema/context/spring-context-3.0.xsd
                        http://www.springframework.org/schema/mvc
                        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

    <!-- **************************************************************** -->
    <!-- RESOURCE FOLDERS CONFIGURATION -->
    <!-- Dispatcher configuration for serving static resources -->
    <!-- **************************************************************** -->
    <mvc:resources location="/static/" mapping="/static/**" />
    <mvc:resources location="/lib/" mapping="/lib/**" />
    <mvc:resources location="/_firebug/" mapping="/_firebug/**" />
    <!--mvc:resources location="/css/" mapping="/css/**" /-->

    <!-- **************************************************************** -->
    <!-- SPRING ANNOTATION PROCESSING -->
    <!-- **************************************************************** -->
    <mvc:annotation-driven />
    <context:component-scan
        base-package="org.iri_research.renkan.controller" />
         
    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.UrlBasedViewResolver">
        <property name="viewClass"
            value="org.springframework.web.servlet.view.JstlView" />
        <property name="prefix" value="/WEB-INF/jsp/" />
        <property name="suffix" value=".jsp" />
        <property name="order" value="2" />
    </bean>
    
    <bean id="templateResolver" class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
        <property name="prefix" value="/WEB-INF/templates/" />
        <property name="suffix" value=".html" />
        <property name="templateMode" value="HTML5" />
        <property name="characterEncoding" value="UTF-8" />
        <property name="cacheable" value="false"/>
    </bean>
    
    <bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine">
        <property name="templateResolver" ref="templateResolver" />
    </bean>
    
    <bean class="org.thymeleaf.spring3.view.ThymeleafViewResolver">
        <property name="templateEngine" ref="templateEngine" />
        <property name="order" value="1" />
        <!--property name="viewNames" value="*.html,*.xhtml" /-->
        <property name="characterEncoding" value="UTF-8"/>
    </bean>
    
    <bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource">
        <property name="basenames" value="WEB-INF/i18n/messages"/>
        <property name="defaultEncoding" value="UTF-8"/>
        <property name="fallbackToSystemLocale" value="true" />       
    </bean>
    
</beans>