Spring MVC Velocity

Source: Internet
Author: User

<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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.