---
title: "让tomcat6支持shtml"
author: "g21121"
date: "2011-06-17T14:38:01Z"
tags: []
categories: ["企业架构"]
slug: "tomcat6-shtml"
draft: false
lastmod: "2011-10-24T10:41:17Z"
id: 1096590
url: "https://286.iteye.com/blog/1096590"
---

tomcat默认是不支持sheml的，但是想要让他支持也很简单，首先打开conf下的**context.xml** ,在context标签添加privileged="true"

然后打开**web.xml**把ssi相关的注释全打开，重启服务就行了

在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>
```

 

是用来解决乱码问题的

并且去掉下面shtml的注释

```
    <mime-mapping>
        <extension>shtml</extension>
        <mime-type>text/x-server-parsed-html</mime-type>
    </mime-mapping>
```

 

这样就可以显示shtml了