1. Modify the Web. xml file under Tomcat's Conf folder to find the following code and uncomment the code.
1 <servlet>2 3 <Servlet-name>Ssi</Servlet-name>4 5 <Servlet-class>6 7 Org.apache.catalina.ssi.SSIServlet8 9 </Servlet-class>Ten One <Init-param> A - <Param-name>Buffered</Param-name> - the <Param-value>1</Param-value> - - </Init-param> - + <Init-param> - + <Param-name>Debug</Param-name> A at <Param-value>0</Param-value> - - </Init-param> - - <Init-param> - in <Param-name>Expires</Param-name> - to <Param-value>666</Param-value> + - </Init-param> the * <Init-param> $ Panax Notoginseng <Param-name>Isvirtualwebapprelative</Param-name> - the <Param-value>0</Param-value> + A </Init-param> the + <Init-param> - $ <Param-name>Inputencoding</Param-name> $ - <Param-value>Utf-8</Param-value> - the </Init-param> - Wuyi <Init-param> the - <Param-name>Outputencoding</Param-name> Wu - <Param-value>Utf-8</Param-value> About $ </Init-param> - - <!--in the first paragraph, we need to add an analytic Chinese code - - A <Init-param> + the <Param-name>Inputencoding</Param-name> - $ <Param-value>Utf-8</Param-value> the the </Init-param> the the <Init-param> - in <Param-name>Outputencoding</Param-name> the the <Param-value>Utf-8</Param-value> About the </Init-param> the the <Load-on-startup>4</Load-on-startup> + - </servlet> the Bayi <servlet-mapping> the the <Servlet-name>Ssi</Servlet-name> - - <Url-pattern>*.shtml</Url-pattern> the the </servlet-mapping>
2. Modify the Context.xml file under Tomcat's Conf folder to add the Privileged= "true" property to the context node
1 < Privileged= "true">23<Watchedresource >web-inf/web.xml</watchedresource>45 </Context>
How to use SSI:
HTML is not included in the page function, in order to use the inclusion function in the statement page, it needs to be implemented through the *.shtml page, and so that Tomcat can correctly display the shtml content needs to go through the above modification. The code for using the inclusion page in sHTML is as follows: There are 3 HTML pages in the index.shtml.
1 <!--Inclusion header.html page -2 <!--#include virtual= "header.html" -3 4 <!--Inclusion news.html page -5 <!--#include virtual= "news.html" -6 7 <!--Inclusion footer.html page -8 <!--#include virtual= "footer.html" -
TOMCAT7 configuration SSI, while solving Chinese garbled problem