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.
你们中的任何人都在JBoss中启用了SSI(ServerSide Includes)吗?我想它应该不难,因为它是建立在Tomcat实例之上的。
1 个解决方案
#1
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
Tomcat已经在catalina.jar中包含了org.apache.catalina.ssi.SSIServlet,因此只需声明servlet并将其附加到映射URL,方法是在应用程序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.
我把所有参数,你可以在这个Tomcat SSI参考中看到它们的定义。
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.
正如文档所说,SSI可以绕过安全策略,因此必须具有特权,这样做会更改位于deploy文件夹内的jboss-web.deploy中的context.xml。只需将privileged =“true”添加到根元素即可。
<Context ... privileged="true">
The servlet will just act as a proxy for the files matching the URL of its mapping.
servlet将充当与其映射的URL匹配的文件的代理。
#1
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
Tomcat已经在catalina.jar中包含了org.apache.catalina.ssi.SSIServlet,因此只需声明servlet并将其附加到映射URL,方法是在应用程序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.
我把所有参数,你可以在这个Tomcat SSI参考中看到它们的定义。
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.
正如文档所说,SSI可以绕过安全策略,因此必须具有特权,这样做会更改位于deploy文件夹内的jboss-web.deploy中的context.xml。只需将privileged =“true”添加到根元素即可。
<Context ... privileged="true">
The servlet will just act as a proxy for the files matching the URL of its mapping.
servlet将充当与其映射的URL匹配的文件的代理。