1.SSI is the abbreviation for Server Side includes, which is a set of instructions embedded in an HTML page. Upon returning the requested page (before the SSI Directive), the server processes the instructions, replaces the instructions with the processed results, and returns the page. This allows dynamically generated content to be added to the HTML page.
2. Configuration: Tomcat6
Open commented-out SSI servlet and servlet-mapping in Web. XML under the Conf package
<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> <Load-on-startup>4</Load-on-startup> </servlet> <servlet-mapping> <Servlet-name>Ssi</Servlet-name> <Url-pattern>*.shtml</Url-pattern> </servlet-mapping>
Add a configuration under the Conf package context.xml
<= "true">
The page display garbled solution is added in the SSI servlet configuration under the Conf package in Web. xml:
Note: The utf-8 should be the same as the page encoding
<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>
Introduction File Mode:
<!---<!-- -
This article references: http://www.codesky.net/article/201107/148798.html
Tomcat supports SSI feature configuration