Rory's Blog
Happy study,Happy work,Happy life
posts - 22,  comments - 44,  trackbacks - 0

     虽然项目全部采用了UTF-8编码,所有的源文件*.java,*.jsc,*.html,*.ftl都采用了UTF-8编码。可是还是出现了乱码问题。很是不爽,后来找到了tomcat,和resin的配置。

  1. Tomcat的配置。(conf/server.xml)
        <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
        
    <Connector port="80" maxHttpHeaderSize="8192"
                   maxThreads
    ="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups
    ="false" redirectPort="8443" acceptCount="100"
                   connectionTimeout
    ="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>
  2. Resin的配置。(conf/resin.conf)

    character-encoding

    Resin 1.1
    child of: resin, server, host-default, host, web-app-default, web-app
    default: The default value is ISO-8859-1.

    Specifies the default character encoding for the environment.

    <web-app id='/'>
      <character-encoding>shift_jis</character-encoding>
      ...
    
    </web-app>
    

     这个是resin doc里面的我是在web-app-default里面加上了encoding的配置

     < web-app-default >
      
< character-encoding > UTF-8 </ character-encoding >
      
    
</ web-app-default >

希望对你的项目有帮助。

创造共用协议:署名,非商业,保持一致    除经特别注明外,本文章版权归莫多泡泡所有.
署名,非商业用途,保持一致.   somebody(莫多)  

posted @ 2006-07-22 18:13 莫多 阅读(963) | 评论 (4)编辑 收藏

<2006年7月>
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

常用链接

留言簿

随笔分类(27)

随笔档案(22)

Friends

搜索

  •  

积分与排名

  • 积分 - 35930
  • 排名 - 268

最新评论

阅读排行榜

评论排行榜