<bean id= "Velocityconfigurer" class= "Org.springframework.web.servlet.view.velocity.VelocityConfigurer" >
<property name= "Resourceloaderpath" ><!--the path to the paging file, relative to WebApp--
<value>templates
</value>
</property>
<!--The Velocity property is configured--
<property name= "Velocityproperties" >
<props>
<prop key= "input.encoding" >UTF-8</prop><!--specify template engine for template processing--
<prop key= "output.encoding" >UTF-8</prop><!--Specify the encoding of the output stream--
<prop key= "ContentType" >text/html;charset=UTF-8</prop><!--contentType--
<prop key= "velocimacro.library" >macro/macros.vm</prop><!--List of Velocimacro template libraries--
<prop key= "Eventhandler.referenceinsertion.class" > Com.sde.common.web.escape.reference.noescapehtmlreference</prop>
<prop key= "Eventhandler.noescape.html.match" >/(?: screen_content) | (?: noescape_.*)/</prop>
</props>
</property>
</bean>
<bean id= "Viewresolver" class= "Org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver" >
<property name= "Cache" value= "false"/><!--whether to cache the template--
<property name= "prefix" value= ""/>
<property name= "suffix" value= ". VM"/>
<property name= "toolboxconfiglocation" value= "/web-inf/toolbox.xml"/><!--Toolbox configuration file Path--
<property name= "Datetoolattribute" value= "date"/><!--Date Function name---<property name= "numbertoolattribut E "value=" number "/><!--numeric function name--
<property name= "ContentType" value= "Text/html;charset=utf-8"/>
<property name= "Exposespringmacrohelpers" value= "true"/><!--whether to use spring support for macro definitions--
<property name= "Exposerequestattributes" value= "true"/><!--Open Request Property--
<property name= "Requestcontextattribute" value= "RC"/><!--Request Property Reference name--
<property name="layoutUrl" value="templates/layout/default.vm"/<!--指定layout文件-->
</bean>
Spring MVC Velocity