To meet this requirement, we need to use different pages based on different parameters, that is, page customization. After reading the information, we can see that velocity can achieve this, and spring can provide perfect support. Therefore, we use the following Configuration:
<bean id="velocityConfigurer" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer"><property name="resourceLoaderPath" value=""></property> <property name="velocityProperties"> <props> <prop key="input.encoding">UTF-8</prop> <prop key="output.encoding">UTF-8</prop> <prop key="contentType">text/html;charset=UTF-8</prop> <prop key="file.resource.loader.path">E:\\home\\downjoy\\velocity\\</prop> </props> </property> </bean>
<bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver"><property name="suffix" value=".vm"></property><property name="contentType" value="text/html;charset=UTF-8" /></bean>
By the way, the Chinese Garbled text problem has been solved ~~~