posts - 73,  comments - 55,  trackbacks - 0
(转自http://leaf.jdk.cn/article.asp?id=39)
    虽然项目全部采用了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>

希望对你的项目有帮助。

posted on 2006-11-16 10:59 保尔任 阅读(214) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

<2006年11月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

常用链接

留言簿(4)

随笔分类

随笔档案

文章分类

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜