379089 DefaultServlet ignores its resourceBase and uses context's ResourceCollection when listing diretories
This commit is contained in:
parent
b281b037dd
commit
ea557759b3
jetty-servlet/src/main/java/org/eclipse/jetty/servlet
|
@ -734,9 +734,14 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
||||||
byte[] data=null;
|
byte[] data=null;
|
||||||
String base = URIUtil.addPaths(request.getRequestURI(),URIUtil.SLASH);
|
String base = URIUtil.addPaths(request.getRequestURI(),URIUtil.SLASH);
|
||||||
|
|
||||||
// handle ResourceCollection
|
//If the DefaultServlet has a resource base set, use it
|
||||||
if (_resourceBase instanceof ResourceCollection)
|
if (_resourceBase != null)
|
||||||
resource=_resourceBase.addPath(pathInContext);
|
{
|
||||||
|
// handle ResourceCollection
|
||||||
|
if (_resourceBase instanceof ResourceCollection)
|
||||||
|
resource=_resourceBase.addPath(pathInContext);
|
||||||
|
}
|
||||||
|
//Otherwise, try using the resource base of its enclosing context handler
|
||||||
else if (_contextHandler.getBaseResource() instanceof ResourceCollection)
|
else if (_contextHandler.getBaseResource() instanceof ResourceCollection)
|
||||||
resource=_contextHandler.getBaseResource().addPath(pathInContext);
|
resource=_contextHandler.getBaseResource().addPath(pathInContext);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue