freemarker+spring中文乱码的解决,办法就是

1 .ftl文件中写好编码
   <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

2 配置中

   <!-- freemarker页面解析器-->
<bean >
  <property name="suffix">
    <value>.ftl</value>
  </property>
 <property name="contentType" value="text/html;charset=gb2312"></property>
 
</bean>

<!-- 配置Freemarker -->
<bean >
  <property name="templateLoaderPath">
    <value>/WEB-INF/ftl/</value>
  </property>
  
</bean>

相关文章:

  • 2022-01-10
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2022-02-15
  • 2021-10-12
  • 2021-06-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
相关资源
相似解决方案