+
+ /* ------------------------------------------------------------ */
+ private void adaptForcedPathToJspContainer (ServletRequest request)
+ {
+ if (_forcedPath != null && _jspContainer != null && JspContainer.GLASSFISH.equals(_jspContainer))
+ {
+ //if container is glassfish, set the request attribute org.apache.catalina.jsp_file to
+ //ensure the delegate jsp will be compiled
+
+ request.setAttribute("org.apache.catalina.jsp_file",_forcedPath);
+ }
+ }
+
+ /* ------------------------------------------------------------ */
+ private void detectJspContainer ()
+ {
+ if (_jspContainer == null)
+ {
+ //check for glassfish
+ try
+ {
+ //if container is glassfish, set the request attribute org.apache.catalina.jsp_file to
+ //ensure the delegate jsp will be compiled
+ Loader.loadClass(Holder.class, GLASSFISH_SENTINEL_CLASS);
+ if (LOG.isDebugEnabled())LOG.debug("Glassfish jasper detected");
+ _jspContainer = JspContainer.GLASSFISH;
+ }
+ catch (ClassNotFoundException e)
+ {
+ try
+ {
+ //check for apache
+ Loader.loadClass(Holder.class, APACHE_SENTINEL_CLASS);
+ if (LOG.isDebugEnabled())LOG.debug("Apache jasper detected");
+ _jspContainer = JspContainer.APACHE;
+ }
+ catch (ClassNotFoundException x)
+ {
+ if (LOG.isDebugEnabled())LOG.debug("Other jasper detected");
+ _jspContainer = JspContainer.OTHER;
+ }
+ }
+ }
+ }
+