Tomcat 6 配置SSI
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: Servlet of class org.apache.catalina.ssi.SSIServlet is
privileged and cannot be loaded by this web application
==================================修改context.xml==================================
在标签<Context>里加入 privileged="true"
变为:
<Context privileged="true">
==========================tomcat6重启 以运行包含页面但乱码=======================
修改conf/web.xml
在conf/web.xml中的ssi servlet配置中添加以下初始配置:
<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 不乱码了===================?