08-12
06
tomcat5.5 ssi乱码问题解决方案
作者:Java伴侣 日期:2008-12-06
配置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的格式,测试一下,大功告成
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的格式,测试一下,大功告成
评论: 0 | 引用: 0 | 查看次数: 441
发表评论