Tomcat7下配置SSI(解决中文乱码问题)
2012-01-06 10:28
435 查看
web.xml 取消SSI注释
*第一段中需要加上解析中文编码
context.xml 为 Context 加上 privileged="true" 属性 例如:<Context privileged="true">
1 <Context privileged="true">
2
3 <!-- Default set of monitored resources -->
4 <WatchedResource>WEB-INF/web.xml</WatchedResource>
5
6 <!-- Uncomment this to disable session persistence across Tomcat restarts -->
7 <!--
8 <Manager pathname="" />
9 -->
<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
</Context>
不多说直接上代码
/Files/qzsonline/web.xml
/Files/qzsonline/context.xml
SSI用法:
必须为*.shtml页面加载 例如:index.shtml
1 <!-- header -->
2 <!--#include virtual="header.html" -->
3 <!-- news -->
4 <!--#include virtual="news.html" -->
5 <!-- guild -->
6 <!--#include virtual="guild.html" -->
7 <!-- service -->
8 <!--#include virtual="service.html" -->
9 <!-- friendLink -->
<!--#include virtual="friendLink.html" -->
<!-- footer -->
12 <!--#include virtual="footer.html" -->
<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>*.shtml</url-pattern> </servlet-mapping>
*第一段中需要加上解析中文编码
<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>
context.xml 为 Context 加上 privileged="true" 属性 例如:<Context privileged="true">
1 <Context privileged="true">
2
3 <!-- Default set of monitored resources -->
4 <WatchedResource>WEB-INF/web.xml</WatchedResource>
5
6 <!-- Uncomment this to disable session persistence across Tomcat restarts -->
7 <!--
8 <Manager pathname="" />
9 -->
<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
</Context>
不多说直接上代码
/Files/qzsonline/web.xml
/Files/qzsonline/context.xml
SSI用法:
必须为*.shtml页面加载 例如:index.shtml
1 <!-- header -->
2 <!--#include virtual="header.html" -->
3 <!-- news -->
4 <!--#include virtual="news.html" -->
5 <!-- guild -->
6 <!--#include virtual="guild.html" -->
7 <!-- service -->
8 <!--#include virtual="service.html" -->
9 <!-- friendLink -->
<!--#include virtual="friendLink.html" -->
<!-- footer -->
12 <!--#include virtual="footer.html" -->
相关文章推荐
- Tomcat7下配置SSI(解决中文乱码问题)
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器如何配置字符集为utf-8彻底解决中文乱码的问题详解
- JSP,mysql,tomcat下(基于struts2)中文及其乱码问题的解决 5大配置点 使用UTF-8编码
- JavaBug库____tomcat配置解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- j2ee由于tomcat配置问题显示中文乱码的解决方法
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- tomcat服务器配置字符集为utf-8-彻底解决中文乱码问题
- 更改Tomcat配置,解决中文乱码问题
- MyEclipse+tomcat配置解决中文乱码问题
- 修改Tomcat配置文件来解决中文乱码问题