Skip to content

Commit

Permalink
代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
smthing committed Nov 14, 2024
1 parent e2282c5 commit 1da3e4d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,14 @@ private boolean matchForwardWelcome(HttpServletRequest request, HttpServletRespo
if (deploymentInfo.getWelcomeFiles().stream().anyMatch(requestUri::endsWith) || requestUri.indexOf(".") > 0) {
return false;
}
if (requestUri.equals(request.getContextPath())) {
URL url = servletContext.getResource(requestUri.substring(request.getContextPath().length()) + "/");
if (url != null) {
response.sendRedirect(requestUri + "/");
// request.getRequestDispatcher(requestUri.substring(request.getContextPath().length()) + "/").forward(request, response);
return true;
}
// URL url = servletContext.getResource(requestUri.substring(request.getContextPath().length()) + "/");

return false;
}

Expand Down

0 comments on commit 1da3e4d

Please sign in to comment.