# Generated Server-Side Includes

The HTML package provides the com.mortbay.HTML.Include class which is a HTML Element that can be added to a generated HTML page. The Include instance is constructed with a directory and filename and includes the contents of the file into the page at the time of generation. This page has been generated by com.mortbay.Servlets.LookAndFeelServlet which uses the Include element to wrap a HTML stub in the site Look and Feel. This page was generated with the following lines:
    Page page = Page.getLookAndFeel(lookAndFeelName);
    ...
    page.add(new Include(fileBase,
                         request.getServletPath()+
                         request.getPathInfo()));
Where the servletPath /Jetty/Demo has been mapped to LookAndFeelServlet and the pathInfo of /include.html is used to select the file to be wrapped in the look and feel selected in the servlets configuration. The contents of the include.html file is listed below. Not that it does not need to contain any HTML for the header, footer or other visual elements as these are provided by the look and feel page into which the file is included. Further note that the source of the file has been included using another Jetty server side inclusion mechanism, Filters, which are more suitable for non generated pages. So this page is generated by a servlet which uses a generated HTML element to include a file, which in turn uses a filtered include tag to include its own source.