首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Tomcat 六 配置SSI

2012-09-07 
Tomcat 6 配置SSItomcat6配置ssi --- 转?原文地址:http://hi.baidu.com/annleecn/blog/item/5e97bf8e1d1cc

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: 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 不乱码了===================?

热点排行