zheng-ucenter增加thymeleaf视图配置

This commit is contained in:
shuzheng 2017-05-02 22:59:24 +08:00
parent a28d15877c
commit c96448a9b4
1 changed files with 27 additions and 5 deletions

View File

@ -1,14 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation=" xmlns:context="http://www.springframework.org/schema/context"
http://www.springframework.org/schema/beans xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd"> http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- 根目录'/'对应页面 --> <!-- 根目录'/'对应页面 -->
<mvc:view-controller path="/" view-name="/index.jsp"/> <mvc:view-controller path="/" view-name="/index.jsp"/>
<context:property-placeholder location="classpath:config.properties"/>
<!-- thymeleaf视图 -->
<bean id="templateResolver" class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver">
<property name="order" value="0"/>
<property name="prefix" value="${zheng-ui.path}"/>
<property name="suffix" value=""/>
<property name="templateMode" value="HTML"/>
<property name="cacheable" value="false"/>
<!--<property name="cacheable" value="true"/>-->
<!--<property name="cacheTTLMs" value="10000"/>-->
</bean>
<bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine">
<property name="templateResolver" ref="templateResolver"/>
<property name="enableSpringELCompiler" value="true"/>
</bean>
<bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver">
<property name="templateEngine" ref="templateEngine"/>
<property name="characterEncoding" value="UTF-8"/>
<property name="viewNames" value="/${app.name}/*"/>
</bean>
</beans> </beans>