2 Replies Latest reply on Jul 13, 2012 1:48 PM by chris81t

    Using SSI (server-side includes) in JBoss AS 7.1 ( Thunder )

    chris81t Newbie

      Hi folks!

       

      I want to provide SSI ( server-side includes ) in the AS 7.1. I've got a war module in an EAR, which contains amongst other things *.html content like:

       

       

      <!DOCTYPE html>
      <html lang="de">
      <head>
                <meta charset="UTF-8">
                <title>Using SSI</title> 
      </head>
      
      <body>
                <!--#include virtual="header.shtml" -->
                <!--#echo var="DATE_LOCAL" -->
                test page.
      </body>
      
      </html>
      
      

       

      I have found to set following things into the web.xml to activate it:

       

      
      <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>1</param-value>
      
      
          </init-param>
      
      
          <init-param>
      
      
              <param-name>expires</param-name>
      
      
              <param-value>60</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>
      
      
      

       

      but nothing happen's. ( no debug output is given to the server console )

       

      Neigher the #include nor the #echo are working. What's wrong or what I have forget to do? Can anybody help me?

       

      Also I have found following link http://docs.jboss.org/jbossweb/7.0.x/ssi-howto.html

      ....To use the SSI servlet, remove the XML comments from around the SSI servlet and servlet-mapping configuration in $CATALINA_BASE/conf/web.xml....
      

      But where is it? I think the only configuration file is for me the ( using standalone ) standalone.xml in the configuration folder. There I have not found something like SSI.

       

       

      Thanks a lot!!!

        • 1. Re: Using SSI (server-side includes) in JBoss AS 7.1 ( Thunder )
          emollient mind Newbie

           

          --->  apart from the configuration you have added to the web.xml file

           

          step  1 : add the contents to context.xml in the META-INF  folder of your web app

           

          <?xml version="1.0" encoding="UTF-8"?>
          <context privileged="true"/>

           

          also rename your html file to xxx.shtml and not xxx.html

          the reason why ssi servlet is not able to interpret the ssi request

          and change  <!--#include virtual="header.shtml" -->  to  <!--#include virtual="header.html" -->

           

           

          step 2 : Here is the modified .shtml file

           

          <!DOCTYPE html>
          <html lang="de">
          <head>
                    <meta charset="UTF-8">
                    <title>Using SSI</title>
          </head>

           

          <body>
                    <!--#include virtual="header.html" -->
                    <!--#echo var="DATE_LOCAL" -->
                    test page.
          </body>

           

          </html>

           

           

          hope this solves your issue.

           

           

           

          1 of 1 people found this helpful