Java论坛网»Java技术»Spring中怎么配置Velocity
Spring中怎么配置Velocity
问?:
请问各位朋友,Spring中怎么配置Velocity,能给个具体代码最好了,还有UTF-8乱码的问题应该怎么解决。
答!: 1:
自己搞定了,回答一下吧
<!-- VELOCITY SETTING -->
<bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath">
<value>/</value>
</property>
<property name="velocityProperties">
<props>
<prop key="input.encoding">euc-kr</prop>
<prop key="output.encoding">euc-kr</prop>
</props>
</property>
</bean><bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
<property name="cache" value="true"/>
<property name="prefix" value=""/>
<property name="suffix" value=".vm"/>
<property name="contentType"><value>text/html; charset=euc-kr</value></property>
</bean>
<!-- VELOCITY SETTING -->
<bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer">
<property name="resourceLoaderPath">
<value>/</value>
</property>
<property name="velocityProperties">
<props>
<prop key="input.encoding">euc-kr</prop>
<prop key="output.encoding">euc-kr</prop>
</props>
</property>
</bean><bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
<property name="cache" value="true"/>
<property name="prefix" value=""/>
<property name="suffix" value=".vm"/>
<property name="contentType"><value>text/html; charset=euc-kr</value></property>
</bean>
相关JAVA教程:
请问大家我需要买一本或者下载一本什么样的书(有这方面开发经验的朋友给我意见啊)
对象转化成xml
对象转化成xml
初次接触hibernate有些问题不解,急!
学习Java设计模式,大家看了哪些书?怎么学习最快?
再次求求大家了,hibernate问题
问个SWT的问题,希望大家帮忙解决!
各位大大,如何判断客户离开了我的网站...比较棘手
GUI设计中的类型检查
bot.jar包在什么地方可以下载到
javamail:请问怎样获取页面提交的邮件内容的类型即contentType???20分
关于Resin和Tomcat中文乱码的一个非常奇怪的问题