Class ContainerTldBundleDiscoverer

java.lang.Object
org.eclipse.jetty.osgi.boot.jasper.ContainerTldBundleDiscoverer
All Implemented Interfaces:
org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer

public class ContainerTldBundleDiscoverer extends Object implements org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer
ContainerTldBundleDiscoverer Finds bundles that are considered as on the container classpath that contain tlds. The System property org.eclipse.jetty.osgi.tldbundles is a comma separated list of exact symbolic names of bundles that have container classpath tlds. The DeploymentManager context attribute "org.eclipse.jetty.server.webapp.containerIncludeBundlePattern" can be used to define a pattern of symbolic names of bundles that contain container classpath tlds. The matching bundles are converted to URLs that are put onto a special classloader that acts as the parent classloader for contexts deployed by the jetty Server instance (see ServerInstanceWrapper). It also discovers the bundle that contains the jstl taglib and adds it into the "org.eclipse.jetty.server.webapp.containerIncludeBundlePattern" (if it is not already there) so that the WebInfOSGiConfiguration class will add the jstl taglib bundle into the list of container resources. Eg: -Dorg.eclipse.jetty.osgi.tldbundles=org.springframework.web.servlet,com.opensymphony.module.sitemesh
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.osgi.framework.Bundle
    Find the bundle that contains a jstl implementation class, which assumes that the jstl taglibs will be inside the same bundle.
    void
    Some versions of JspFactory do Class.forName, which probably won't work in an OSGi environment.
    URL[]
    getUrlsForBundlesWithTlds(org.eclipse.jetty.deploy.DeploymentManager deploymentManager, org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper locatorHelper)
    Check the System property "org.eclipse.jetty.osgi.tldbundles" for names of bundles that contain tlds and convert to URLs.
    boolean
    Check that jsp is on the classpath

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ContainerTldBundleDiscoverer

      public ContainerTldBundleDiscoverer()
  • Method Details

    • getUrlsForBundlesWithTlds

      public URL[] getUrlsForBundlesWithTlds(org.eclipse.jetty.deploy.DeploymentManager deploymentManager, org.eclipse.jetty.osgi.boot.utils.BundleFileLocatorHelper locatorHelper) throws Exception
      Check the System property "org.eclipse.jetty.osgi.tldbundles" for names of bundles that contain tlds and convert to URLs.
      Specified by:
      getUrlsForBundlesWithTlds in interface org.eclipse.jetty.osgi.boot.utils.TldBundleDiscoverer
      Returns:
      The location of the jars that contain tld files as URLs.
      Throws:
      Exception
    • isJspAvailable

      public boolean isJspAvailable()
      Check that jsp is on the classpath
      Returns:
      true if jsp is available in the environment
    • fixJspFactory

      public void fixJspFactory()
      Some versions of JspFactory do Class.forName, which probably won't work in an OSGi environment.
    • findJstlBundle

      public org.osgi.framework.Bundle findJstlBundle()
      Find the bundle that contains a jstl implementation class, which assumes that the jstl taglibs will be inside the same bundle.
      Returns:
      Bundle contains the jstl implementation class