解决FreeMarker中文乱码问题

在web.xml中配置如下:

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < servlet >
    
< servlet-name > Freemarker </ servlet-name >
    
< servlet-class > freemarker.ext.servlet.FreemarkerServlet </ servlet-class >
    
< init-param >
        
< param-name > TemplatePath </ param-name >
        
< param-value > / </ param-value >
    
</ init-param >
    
< init-param >
        
< param-name > template_update_delay </ param-name >
        
< param-value > 3600 </ param-value >   <!--  0 值仅用于开发环境,生产环境请设置为3600或者更大。  -->
    
</ init-param >
    
< init-param >
        
< param-name > DefaultEncoding </ param-name >   <!--  解决中文编码问题  -->
        
< param-value > utf-8 </ param-value >
    
</ init-param >
    
< load-on-startup > 1 </ load-on-startup >
</ servlet >

--------------------

你可能感兴趣的:(xml,freemarker,Web,servlet,ext)