项目中有一个 alert乱码问题,按照网上的方法改了很久不没反应,结果最终突然灵机一动想到了服务器的编码,结果ok了 ,花了好长时间阿,囧

 

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

  1. Tomcat的配置。(conf/server.xml)
        <!--</span><span style="COLOR: rgb(0,128,0)"> Define a non-SSL HTTP/1.1 Connector on port 8080 </span><span style="COLOR: rgb(0,128,0)">-->
        
    <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.

相关文章:

  • 2021-11-15
  • 2021-12-31
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-01-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2021-08-03
相关资源
相似解决方案