Tomcat7下配置SSI(解决中文乱码问题)
来源:互联网 发布:黑马程序员毕业证 编辑:程序博客网 时间:2024/05/16 08:33
web.xml 取消SSI注释
1 <servlet> 2 <servlet-name>ssi</servlet-name> 3 <servlet-class> 4 org.apache.catalina.ssi.SSIServlet 5 </servlet-class> 6 <init-param> 7 <param-name>buffered</param-name> 8 <param-value>1</param-value> 9 </init-param>10 <init-param>11 <param-name>debug</param-name>12 <param-value>0</param-value>13 </init-param>14 <init-param>15 <param-name>expires</param-name>16 <param-value>666</param-value>17 </init-param>18 <init-param>19 <param-name>isVirtualWebappRelative</param-name>20 <param-value>0</param-value>21 </init-param>22 <init-param>23 <param-name>inputEncoding</param-name>24 <param-value>utf-8</param-value>25 </init-param>26 <init-param>27 <param-name>outputEncoding</param-name>28 <param-value>utf-8</param-value>29 </init-param>30 <load-on-startup>4</load-on-startup>31 </servlet>
1 <servlet-mapping>2 <servlet-name>ssi</servlet-name>3 <url-pattern>*.shtml</url-pattern>4 </servlet-mapping>
*第一段中需要加上解析中文编码
1 <init-param>2 <param-name>inputEncoding</param-name>3 <param-value>utf-8</param-value>4 </init-param>5 <init-param>6 <param-name>outputEncoding</param-name>7 <param-value>utf-8</param-value>8 </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 -->
10
11 <!-- Uncomment this to enable Comet connection tacking (provides events
12 on session expiration as well as webapp lifecycle) -->
13 <!--
14 <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
15 -->
16 </Context>
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 -->
10
11 <!-- Uncomment this to enable Comet connection tacking (provides events
12 on session expiration as well as webapp lifecycle) -->
13 <!--
14 <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
15 -->
16 </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 -->
10 <!--#include virtual="friendLink.html" -->
11 <!-- footer -->
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 -->
10 <!--#include virtual="friendLink.html" -->
11 <!-- footer -->
12 <!--#include virtual="footer.html" -->
- Tomcat7下配置SSI(解决中文乱码问题)
- Tomcat7下配置SSI(解决中文乱码问题)
- 解决tomcat7中文乱码
- Tomcat7 SSI配置
- tomcat7.0配置ssi
- tomcat7 运行在windows环境下乱码问题的解决
- Tomcat7 jsp解决Cookie中文乱码
- Gentoo的字体配置(解决中文乱码问题)
- MyEclipse+tomcat配置解决中文乱码问题
- 更改Tomcat配置,解决中文乱码问题
- 配置web-xml解决中文乱码问题
- 更改Tomcat配置,解决中文乱码问题
- tomcat 6 SSI 配置问题的解决
- tomcat 6 SSI 配置问题的解决
- AJAX下Post表单(解决中文乱码问题)
- AJAX下Post表单(解决中文乱码问题)
- ubuntu下解决mysql插入中文乱码(???)的问题
- linux服务器下mysql的中文乱码问题(解决)
- 大龄程序员的出路
- linux 下 进程和线程的区别
- Rails ActiveRecord数据库关系1:1
- C#Winfrom下调用C++
- TCP/IP详解卷1:协议(第七章:Ping程序) || (第八章:Traceroute程序)
- Tomcat7下配置SSI(解决中文乱码问题)
- (3)http协议之压缩-------3
- 关于爱情
- ios MVC 结构问题
- 转 -- Oracle RAC日常基本维护命令
- iframe提交,做页面无刷新 cao
- 解决linux右上角键盘小图标消失的问题
- Use kdiff3 in git
- (4)Http协议之缓存-----4