Merge remote-tracking branch 'origin/jetty-9.4.x' into issue-1640

This commit is contained in:
Jan Bartel 2017-10-03 14:25:38 +11:00
commit 7a1d076e64
1 changed files with 5 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import java.util.concurrent.ConcurrentHashMap;
import javax.servlet.AsyncContext;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@ -402,7 +403,9 @@ public class ResourceService
if (LOG.isDebugEnabled())
LOG.debug("welcome={}",welcome);
if (_redirectWelcome)
ServletContext context = request.getServletContext();
if (_redirectWelcome || context==null)
{
// Redirect to the index
response.setContentLength(0);
@ -416,7 +419,7 @@ public class ResourceService
return;
}
RequestDispatcher dispatcher=request.getServletContext().getRequestDispatcher(welcome);
RequestDispatcher dispatcher=context.getRequestDispatcher(welcome);
if (dispatcher!=null)
{
// Forward to the index