All Downloads are FREE. Search and download functionalities are using the official Maven repository.

springmvc.spring-mvc-freemarker.xml Maven / Gradle / Ivy

<?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:c="http://www.springframework.org/schema/c"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
	
	<description>freemarker视图设置</description>
	
	
	<bean id="freemarkerSettings" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
	    <property name="location" value="${core.freemarker.freemarkerSettings.location:classpath:properties/freemarker.properties}"/>
	</bean>

	<!-- freemarker的配置 -->
	 <!-- <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> -->
	 <bean id="freemarkerConfig" class="cn.meteor.module.core.freemarker.MeteorTagFreeMarkerConfigurer">
	 <!-- <bean id="freemarkerConfig" class="cn.meteor.module.core.freemarker.ShiroTagFreeMarkerConfigurer"> -->
	  <!-- <property name="templateLoaderPath" value="${freemarker.templateLoaderPath}" /> -->
	  <property name="templateLoaderPath" value="${core.freemarker.freemarkerConfig.templateLoaderPath:/WEB-INF/views/}" />
	  <property name="defaultEncoding" value="${core.freemarker.freemarkerConfig.defaultEncoding:utf-8}" />
	  <property name="freemarkerSettings" ref="freemarkerSettings" />
	  <!-- <property name="freemarkerSettings">
	   <props>
	    <prop key="template_update_delay">10</prop>
	    <prop key="locale">zh_CN</prop>
	    <prop key="datetime_format">yyyy-MM-dd</prop>
	    <prop key="date_format">yyyy-MM-dd</prop>
	    <prop key="number_format">#.##</prop>
	    <prop key="object_wrapper">freemarker.ext.beans.BeansWrapper</prop>
	   </props>
	  </property> -->
	 </bean>
	<bean id="viewResolverFtl" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">	  
	  <!-- <property name="viewClass" value="org.springframework.web.servlet.view.freemarker.FreeMarkerView"></property> -->
	  <property name="viewClass" value="cn.meteor.module.core.freemarker.MyFreeMarkerView"></property>
	  <property name="suffix" value="${core.freemarker.viewResolver.suffix:.ftl}" />
	  <property name="contentType" value="text/html;charset=utf-8" />
	  <property name="exposeRequestAttributes" value="true" />
	  <property name="exposeSessionAttributes" value="true" />
	  <property name="exposeSpringMacroHelpers" value="true" />
	  <property name="order" value="${core.freemarker.viewResolver.order:0}"/>
	 </bean>
	 
</beans>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy