From 3e1082e122acdbc7258bc6111f8e87982433f4f6 Mon Sep 17 00:00:00 2001 From: Mehtab Singh Mann Date: Fri, 4 Mar 2016 19:12:44 +0530 Subject: [PATCH] Issue #356 (Element error-page/location must start with a '/') Signed-off-by: Mehtab Singh Mann --- .../org/eclipse/jetty/webapp/StandardDescriptorProcessor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java index 7f4ad3df206..488b7110119 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/StandardDescriptorProcessor.java @@ -1113,6 +1113,8 @@ public class StandardDescriptorProcessor extends IterativeDescriptorProcessor code=Integer.valueOf(error); String location = node.getString("location", false, true); + if (!location.startsWith("/")) + throw new IllegalStateException("Missing leading '/' for location: " + location); ErrorPageErrorHandler handler = (ErrorPageErrorHandler)context.getErrorHandler(); String originName = "error."+error; switch (context.getMetaData().getOrigin(originName))