Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JettyJasperInitializer.java11
-rw-r--r--jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java11
-rw-r--r--jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java2
3 files changed, 20 insertions, 4 deletions
diff --git a/apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JettyJasperInitializer.java b/apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JettyJasperInitializer.java
index 4cd7993211..9c66c8d699 100644
--- a/apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JettyJasperInitializer.java
+++ b/apache-jsp/src/main/java/org/eclipse/jetty/apache/jsp/JettyJasperInitializer.java
@@ -23,14 +23,14 @@ import java.net.URL;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-import java.util.Set;
import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
import org.apache.jasper.servlet.JasperInitializer;
import org.apache.jasper.servlet.TldPreScanned;
import org.apache.jasper.servlet.TldScanner;
+import org.eclipse.jetty.util.log.Log;
+import org.eclipse.jetty.util.log.Logger;
import org.xml.sax.SAXException;
/**
@@ -39,6 +39,7 @@ import org.xml.sax.SAXException;
*/
public class JettyJasperInitializer extends JasperInitializer
{
+ private static final Logger LOG = Log.getLogger(JettyJasperInitializer.class);
/**
* NullTldScanner
@@ -99,14 +100,18 @@ public class JettyJasperInitializer extends JasperInitializer
String tmp = context.getInitParameter("org.eclipse.jetty.jsp.precompiled");
if (tmp!=null && !tmp.equals("") && Boolean.valueOf(tmp))
{
+ if (LOG.isDebugEnabled()) LOG.debug("Jsp precompilation detected");
return new NullTldScanner(context, namespaceAware, validate, blockExternal);
}
Collection<URL> tldUrls = (Collection<URL>)context.getAttribute("org.eclipse.jetty.tlds");
- if (tldUrls != null && !tldUrls.isEmpty())
+ if (tldUrls != null)
{
+ if (LOG.isDebugEnabled()) LOG.debug("Tld pre-scan detected");
return new TldPreScanned(context,namespaceAware,validate,blockExternal,tldUrls);
}
+
+ if (LOG.isDebugEnabled()) LOG.debug("Defaulting to jasper tld scanning");
return super.newTldScanner(context, namespaceAware, validate, blockExternal);
}
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java
index 4617c02550..b2291012b6 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/MetaInfConfiguration.java
@@ -71,6 +71,17 @@ public class MetaInfConfiguration extends AbstractConfiguration
useContainerCache = attr.booleanValue();
if (LOG.isDebugEnabled()) LOG.debug("{} = {}", USE_CONTAINER_METAINF_CACHE, useContainerCache);
+
+ //pre-emptively create empty lists for tlds, fragments and resources as context attributes
+ //this signals that this class has been called. This differentiates the case where this class
+ //has been called but finds no META-INF data from the case where this class was never called
+ if (context.getAttribute(METAINF_TLDS) == null)
+ context.setAttribute(METAINF_TLDS, new HashSet<URL>());
+ if (context.getAttribute(METAINF_RESOURCES) == null)
+ context.setAttribute(METAINF_RESOURCES, new HashSet<Resource>());
+ if (context.getAttribute(METAINF_FRAGMENTS) == null)
+ context.setAttribute(METAINF_FRAGMENTS, new HashMap<Resource, Resource>());
+
scanJars(context, context.getMetaData().getContainerResources(), useContainerCache);
scanJars(context, context.getMetaData().getWebInfJars(), false);
}
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java
index 1e4096c19c..1e68b1991f 100644
--- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java
+++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java
@@ -175,7 +175,7 @@ public class WebInfConfiguration extends AbstractConfiguration
// Look for extra resource
@SuppressWarnings("unchecked")
Set<Resource> resources = (Set<Resource>)context.getAttribute(RESOURCE_DIRS);
- if (resources!=null)
+ if (resources!=null && !resources.isEmpty())
{
Resource[] collection=new Resource[resources.size()+1];
int i=0;

Back to the top