Class ContainerTldBundleDiscoverer
- java.lang.Object
-
- org.eclipse.jetty.osgi.boot.jasper.ContainerTldBundleDiscoverer
-
- All Implemented Interfaces:
TldBundleDiscoverer
public class ContainerTldBundleDiscoverer extends java.lang.Object implements 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 ContainerTldBundleDiscoverer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.void
fixJspFactory()
Some versions of JspFactory do Class.forName, which probably won't work in an OSGi environment.java.net.URL[]
getUrlsForBundlesWithTlds(DeploymentManager deploymentManager, BundleFileLocatorHelper locatorHelper)
Check the System property "org.eclipse.jetty.osgi.tldbundles" for names of bundles that contain tlds and convert to URLs.boolean
isJspAvailable()
Check that jsp is on the classpath
-
-
-
Method Detail
-
getUrlsForBundlesWithTlds
public java.net.URL[] getUrlsForBundlesWithTlds(DeploymentManager deploymentManager, BundleFileLocatorHelper locatorHelper) throws java.lang.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 interfaceTldBundleDiscoverer
- Parameters:
deploymentManager
- TheDeploymentManager
instance to uselocatorHelper
- theBundleFileLocatorHelper
instance to use- Returns:
- The location of the jars that contain tld files as URLs.
- Throws:
java.lang.Exception
- In case of errors during resolving TLDs files
-
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
-
-