Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Running SSI (Server Side Include) scripts in Apache Tomcat

Server Side Includes provide the web user with a handful of facilities that can be included in their HTML pages, to be parsed out / completed by the server. For example, the date and time can be included in a web page using an SSI.

Both httpd and Tomcat can support SSIs, provided that the server is configured to provide the support; where the configuration IS done, it's usual for an extension .sht or .shtml to be used.

SAMPLE SSI SCRIPT

Here's a sample "ssi" script that you might want to install on your Tomcat server:

<head><title>Linux, Apache httpd, Tomcat, MySQL, Java</title></head>
<body><h1>Linux, Apache httpd, Tomcat, MySQL and Java</h1>
This is part of a sample web application that tests Tomcat deployment.
<hr>
Server side include - date is <!--#echo var="DATE_LOCAL" -->
<hr>
Page written by Well House Consultants Ltd, +44 (0) 1225 708225<br>
web <a href=http://www.wellho.net>http://www.wellho.net</a><br>
email <a href=mailto:info@wellho.net>info@wellho.net</a><br>
</body>

CONFIGURING TOMCAT TO SUPPORT SSI

Although SSI support is shipped with the standard Tomcat load, the vital information that you'll need is commented out in the web.xml file and you need to uncomment the following to add in the support:

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

and also you need to map appropriate URLs on to that support:

    <servlet-mapping>
        <servlet-name>ssi</servlet-name>
        <url-pattern>*.shtml</url-pattern>
    </servlet-mapping>

There's one further change to make - the SSI API is provided in a .jar file that you need to rename in the /usr/local/tomcat/server/lib (or similarly named) directory:

mv servlets-ssi.renametojar servlets-ssi.jar



See also Deploying applications under httpd and Tomcat

Please note that articles in this section of our web site were current and correct to the best of our ability when published, but by the nature of our business may go out of date quite quickly. The quoting of a price, contract term or any other information in this area of our website is NOT an offer to supply now on those terms - please check back via our main web site

Related Material

Web Application Deployment - Tomcat - Configuring Web Applications
  [465] - ()
  [479] - ()
  [754] - ()
  [1006] - ()
  [1074] - ()
  [1082] - ()
  [1192] - ()
  [1552] - ()
  [1564] - ()
  [1909] - ()
  [2088] - ()
  [3044] - ()
  [3996] - ()

Web Application Deployment - Tomcat -Sourcing, Installing and Initial Testing
  [837] - ()
  [1049] - ()
  [1550] - ()
  [2088] - ()
  [3819] - ()

Web and Intranet - Executable Content
  [1812] - ()
  [1813] - ()
  [1814] - ()
  [2628] - ()

resource index - Java
Solutions centre home page

You'll find shorter technical items at The Horse's Mouth and delegate's questions answered at the Opentalk forum.

At Well House Consultants, we provide training courses on subjects such as Ruby, Lua, Perl, Python, Linux, C, C++, Tcl/Tk, Tomcat, PHP and MySQL. We're asked (and answer) many questions, and answers to those which are of general interest are published in this area of our site.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/solutions/java-run ... omcat.html • PAGE BUILT: Wed Mar 28 07:47:11 2012 • BUILD SYSTEM: wizard