TOMCAT7 configuration SSI, while solving Chinese garbled problem

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.