From 573cccb8dfc57b7db0f85a0ba0736c80bc23fac7 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 19 May 2009 00:52:02 +0000 Subject: [PATCH] inverted the sense of aliases on contextHandler git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@226 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../org/eclipse/jetty/server/handler/ContextHandler.java | 8 ++++---- .../java/org/eclipse/jetty/servlet/DefaultServlet.java | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java index fb244a1ffa9..14b4975ac44 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java @@ -119,7 +119,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. private boolean _allowNullPathInfo; private int _maxFormContentSize=Integer.getInteger("org.eclipse.jetty.server.Request.maxFormContentSize",200000).intValue(); private boolean _compactPath=false; - private boolean _aliases=true; + private boolean _aliases=false; private Object _contextListeners; private Object _contextAttributeListeners; @@ -1154,7 +1154,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. } /* ------------------------------------------------------------ */ /** - * @return True if alias checking is performed on resources. + * @return True if aliases are allowed */ public boolean isAliases() { @@ -1163,7 +1163,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. /* ------------------------------------------------------------ */ /** - * @param aliases alias checking performed on resources. + * @param aliases aliases are allowed */ public void setAliases(boolean aliases) { @@ -1325,7 +1325,7 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. path=URIUtil.canonicalPath(path); Resource resource=_baseResource.addPath(path); - if (_aliases && resource.getAlias()!=null) + if (!_aliases && resource.getAlias()!=null) { if (resource.exists()) Log.warn("Aliased resource: "+resource+"~="+resource.getAlias()); diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java index 532019b6c81..15a5820a148 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java @@ -157,6 +157,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory if (getInitParameter("aliases")!=null) _contextHandler.setAliases(getInitBoolean("aliases",false)); + boolean aliases=_contextHandler.isAliases(); if (!aliases && !FileResource.getCheckAliases()) throw new IllegalStateException("Alias checking disabled");