tags:

views:

230

answers:

1

Any of you guys have enabled SSI (ServerSide Includes) in JBoss? I guess it should be not difficult as it is built on top of a Tomcat instance.

+2  A: 

Tomcat already includes in catalina.jar the org.apache.catalina.ssi.SSIServlet so just declare the servlet and attach it to a mapping URL, by setting this in the applications web.xml

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

I put all the parameters, you can see their definition in this Tomcat SSI reference.

As the doc says, SSI can bypass security policies so it must be privileged, do this changing the context.xml located in jboss-web.deploy inside the deploy folder. Just add privileged="true" to the root element.

<Context ... privileged="true">

The servlet will just act as a proxy for the files matching the URL of its mapping.

victor hugo