We know that to run shtml, ssi must be configured on the web server.
The following is the configuration method of SSI on tomcat5.*:
Open the tomcat configuration file: conf/web.xml:
/* <servlet>
before the servlet below.
<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>
*/
Change to
<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>
2. Remove the servlet mapping annotation
/*<servlet-mapping>
<servlet-name>ssi</servlet-name>
<url-pattern>*.shtml</url-pattern>
</servlet-mapping>
*/
Change to
<servlet-mapping>
<servlet-name>ssi</servlet-name>
<url-pattern>*.shtml</url-pattern>
</servlet-mapping>
3. Find the servlets-ssi.renametojar file in the serverlib directory and change it to servlets-ssi.jar
4. Restart tomcat
5. Create a new shtml file to test
<HTML>
<HEAD>
<TITLE>shtml test</TITLE>
</HEAD>
<BODY>
<!–#echo var=”DATE_LOCAL” –>
<!–#include virtual=”hello.jsp”–>
</BODY>
</HTML>
Execute ok! ! !