IndexOutOfBoundsException with Catalina SSI Servlet

I played around with some Server Side Includes using org.apache.catalina.ssi.SSIServlet and noticed that some statements (which were fine on Apache) are not working on GlassFish. Finally I found the solution.

In Apache (using mod_ssi) you can do this:

<!--#if expr="{$HTTP_USER_AGENT} == /(iPhone)/" -->
<p>It's an iPhone.</p>
<!--#endif -->

But on GlassFish Server (with SSIServlet) you have to do this:

<!--#if expr="{$HTTP_USER_AGENT} = '/(iPad)/'" -->
<p>It's an iPhone.</p>
<!--#endif -->

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.