summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-06-28 19:00:08 +0300
committerLeif Åstrand <leif@vaadin.com>2012-06-28 19:00:08 +0300
commit0026faa5f5796c68fd4e96afdbd8574dc54a515d (patch)
tree3a340a17c82f736cccb92f9bad258759d05515d4
parent060ba3b63cf1c46bb726a6f6f0910924fb185364 (diff)
downloadvaadin-framework-0026faa5f5796c68fd4e96afdbd8574dc54a515d.tar.gz
vaadin-framework-0026faa5f5796c68fd4e96afdbd8574dc54a515d.zip
Add logging for rejected connector resource requests (#9048)
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 8c4377ac64..ba17822813 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -2407,6 +2407,9 @@ public abstract class AbstractCommunicationManager implements Serializable {
// Security check: avoid accidentally serving from the root of the
// classpath instead of relative to the context class
if (resourceName.startsWith("/")) {
+ getLogger().warning(
+ "Connector resource request starting with / rejected: "
+ + resourceName);
response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName);
return;
}
@@ -2420,6 +2423,9 @@ public abstract class AbstractCommunicationManager implements Serializable {
// Security check: don't serve resource if the name hasn't been
// registered in the map
if (context == null) {
+ getLogger().warning(
+ "Connector resource request for unkown resource rejected: "
+ + resourceName);
response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName);
return;
}
@@ -2427,6 +2433,12 @@ public abstract class AbstractCommunicationManager implements Serializable {
// Resolve file relative to the location of the context class
InputStream in = context.getResourceAsStream(resourceName);
if (in == null) {
+ getLogger().warning(
+ resourceName + " defined by " + context.getName()
+ + " not found. Verify that the file "
+ + context.getPackage().getName().replace('.', '/')
+ + '/' + resourceName
+ + " is available on the classpath.");
response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName);
return;
}