﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-kingmove-文章分类-tomcat</title><link>http://www.blogjava.net/kingmove/category/40487.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 26 Jun 2009 19:23:10 GMT</lastBuildDate><pubDate>Fri, 26 Jun 2009 19:23:10 GMT</pubDate><ttl>60</ttl><item><title>Tomcat 配置SSI</title><link>http://www.blogjava.net/kingmove/articles/284256.html</link><dc:creator>KingMove</dc:creator><author>KingMove</author><pubDate>Fri, 26 Jun 2009 05:28:00 GMT</pubDate><guid>http://www.blogjava.net/kingmove/articles/284256.html</guid><description><![CDATA[在目前的Tomcat中，shtml默认是不支持的，需要进行一定的配置，其实也不是非常复杂，不同的Tomcat版本，配置方法也有所不同，参考方法如下： <br />
<br />
<br />
&nbsp; &nbsp; Tomcat5.x版的配置方法： <br />
<br />
1.在$CATALINA_BASE/server/lib/目录下找到servlets-ssi.renametojar文件,将这个文件重命名为servlets-ssi.jar <br />
2.在$CATALINA_BASE/conf/目录下找到web.xml文件 <br />
3.使用SSI Servlet的话删除在SSI servlet和servlet-mapping周围的注释，使用SSI filter的话删除在SSI filter和filter-mapping周围的注释 <br />
<br />
&nbsp; &nbsp; tomcat 6 SSI的配置与5.x版本不同，下面介绍tomcat 6 SSI的配置方法 <br />
<br />
&nbsp; Tomcat6版的配置方法： <br />
<br />
1.在$CATALINA_BASE/conf/目录下找到web.xml文件 <br />
2.使用SSI Servlet的话删除在SSI servlet和servlet-mapping周围的注释，使用SSI filter的话删除在SSI filter和filter-mapping周围的注释 <br />
3.$CATALINA_BASE/conf/下还有一个context.xml，将里面的 &lt;Context&gt;改成 &lt;Context privileged="true"&gt; <br />
4.解决乱码问题 <br />
在$CATALINA_BASE/conf/web.xml中的ssi servlet配置中添加以下初始配置: <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;init-param&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param-name&gt;inputEncoding &lt;/param-name&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param-value&gt;utf-8 &lt;/param-value&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/init-param&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;init-param&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param-name&gt;outputEncoding &lt;/param-name&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;param-value&gt;utf-8 &lt;/param-value&gt; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/init-param&gt; <br />
<br />
其中utf-8编码应该和你页面的编码方式一样 <br />
更多请参考官方的配置说明http://tomcat.apache.org/tomcat-6.0-doc/ssi-howto.html <br />
<br />
<br />
&nbsp; &nbsp; 经过上面的配置，包含文件： <br />
&lt;!--#include file="include.html" --&gt; <br />
&lt;!--#include virtual="include.html" --&gt; <br />
才可以正常显示。 <br />
 <img src ="http://www.blogjava.net/kingmove/aggbug/284256.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kingmove/" target="_blank">KingMove</a> 2009-06-26 13:28 <a href="http://www.blogjava.net/kingmove/articles/284256.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>