08-12
06

tomcat5.5 ssi乱码问题解决方案

配置ssi后,出现乱码问题,现将解决方案如下:

1. 下载tomcat5.5.29的zip版本,下载地址http://tomcat.apache.org/download-55.cgi
2. 找到server/lib下的servlets-ssi.renametojar,将其改名为servlets-ssi.jar后,复制并到本机tomcat安装路径$CATALINA_BASE/server/lib/下,覆盖原来的文件
3. 修改$CATALINA_BASE/conf/web.xml下的ssi配置,红色字体为新增的内容,如下:
    <servlet>
        <servlet-name>ssi</servlet-name>
        <servlet-class>
          org.apache.catalina.ssi.SSIServlet
        </servlet-class>
        <init-param>
          <param-name>buffered</param-name>
          <param-value>1</param-value>
        </init-param>
        <init-param>
          <param-name>debug</param-name>
          <param-value>0</param-value>
        </init-param>
        <init-param>
          <param-name>expires</param-name>
          <param-value>666</param-value>
        </init-param>
        <init-param>
          <param-name>isVirtualWebappRelative</param-name>
          <param-value>0</param-value>
        </init-param>
        <init-param>
          <param-name>inputEncoding</param-name>
          <param-value>utf-8</param-value>
        </init-param>
        <init-param>
          <param-name>outputEncoding</param-name>
          <param-value>utf-8</param-value>
        </init-param>
        <load-on-startup>4</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>ssi</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>

4. 我的网页都是utf-8的格式,测试一下,大功告成


文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: ssi
相关日志:
评论: 0 | 引用: 0 | 查看次数: 439
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭