applicationContext-mvc.xml 3.68 KB
Newer Older
eddie.woo's avatar
eddie.woo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<?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" xmlns:tx="http://www.springframework.org/schema/tx"
	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-4.3.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">


	<!-- **************************************************************** -->
	<!-- Spring-MVC配置 -->
	<!-- **************************************************************** -->
	<mvc:resources mapping="/**" location="/" />

	<mvc:resources mapping="/webjars/**"
		location="classpath:/META-INF/resources/webjars/" />

	<context:component-scan base-package="pwc.taxtech.atms">
		<context:include-filter type="annotation"
			expression="pwc.taxtech.atms.WebContext" />
	</context:component-scan>

	<mvc:annotation-driven>
		<mvc:message-converters>
			<!-- <ref bean="fastJsonHttpMessageConverter" /> -->
			<ref bean="mappingJackson2HttpMessageConverter" />
		</mvc:message-converters>
	</mvc:annotation-driven>

	<!-- **************************************************************** -->
	<!-- 整合Thymeleaf3 -->
	<!-- See: http://www.thymeleaf.org/doc/tutorials/3.0/thymeleafspring.html -->
	<!-- **************************************************************** -->
35 36 37 38 39 40 41 42
	<!--<bean id="templateResolver"-->
		<!--class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver">-->
		<!--<property name="prefix" value="/WEB-INF/templates/" />-->
		<!--<property name="suffix" value=".html" />-->
		<!--<property name="templateMode" value="HTML" />-->
		<!--<property name="cacheable" value="false" />-->
		<!--<property name="characterEncoding" value="UTF-8" />-->
	<!--</bean>-->
eddie.woo's avatar
eddie.woo committed
43

44 45 46 47 48 49 50 51 52 53 54 55
	<!--<bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine">-->
		<!--<property name="templateResolver" ref="templateResolver" />-->
		<!--<property name="enableSpringELCompiler" value="true" />-->
		<!--<property name="additionalDialects">-->
			<!--<set>-->
				<!--&lt;!&ndash; Note the package would change to 'springsecurity3' if you are using -->
					<!--that version &ndash;&gt;-->
				<!--<bean-->
					<!--class="org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect" />-->
			<!--</set>-->
		<!--</property>-->
	<!--</bean>-->
eddie.woo's avatar
eddie.woo committed
56

57 58 59 60 61 62
	<!--&lt;!&ndash; html文件不能放在这个目录:WEB-INF/templates/jsp &ndash;&gt;-->
	<!--<bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver">-->
		<!--<property name="templateEngine" ref="templateEngine" />-->
		<!--<property name="characterEncoding" value="UTF-8" />-->
		<!--<property name="order" value="100" />-->
	<!--</bean>-->
eddie.woo's avatar
eddie.woo committed
63

64 65 66 67 68 69 70 71 72 73 74
	<!--&lt;!&ndash; 共用jsp与thymeleaf,为了避免冲突,jsp viewname的前缀必须是jsp/ &ndash;&gt;-->
	<!--&lt;!&ndash; jsp文件必须放在这个目录:WEB-INF/templates/jsp &ndash;&gt;-->
	<!--<bean id="viewResolver"-->
		<!--class="org.springframework.web.servlet.view.InternalResourceViewResolver">-->
		<!--<property name="viewClass"-->
			<!--value="org.springframework.web.servlet.view.JstlView" />-->
		<!--<property name="prefix" value="/WEB-INF/templates/" />-->
		<!--<property name="suffix" value=".jsp" />-->
		<!--<property name="order" value="50" />-->
		<!--<property name="viewNames" value="jsp/*" />-->
	<!--</bean>-->
eddie.woo's avatar
eddie.woo committed
75 76

</beans>