Tomcat 6 配置SSI

tomcat6配置ssi --- 转 
原文地址:http://hi.baidu.com/annleecn/blog/item/5e97bf8e1d1cc0f0f01f36d5.html

1.去掉tomcat6中conf/web.xml关于ssi的注释

===================================(1)===========================================

<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>

<load-on-startup>4</load-on-startup>

</servlet>

=====================================(2)==========================================

<servlet-mapping>

<servlet-name>ssi</servlet-name>

<url-pattern>*.shtml</url-pattern>

</servlet-mapping>

=================================tomcat6重启出错=================================

java.lang.SecurityException:Servletofclassorg.apache.catalina.ssi.SSIServletis

privilegedandcannotbeloadedbythiswebapplication

==================================修改context.xml==================================

在标签<Context>里加入privileged="true"

变为:

<Contextprivileged="true">

==========================tomcat6重启以运行包含页面但乱码=======================

修改conf/web.xml

在conf/web.xml中的ssiservlet配置中添加以下初始配置:

<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>

修改为:

<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>

===========================重启tomcat6仍乱码===================

=====================过一两分钟再重启tomcat6不乱码了===================

相关推荐