mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for redirect
This commit is contained in:
@@ -60,9 +60,18 @@ public class StatViewServlet extends HttpServlet {
|
||||
}
|
||||
String uri = contextPath + servletPath;
|
||||
String path = requestURI.substring(contextPath.length() + servletPath.length());
|
||||
|
||||
if ("".equals(path)) {
|
||||
if (contextPath == null || contextPath.equals("") || contextPath.equals("/")) {
|
||||
response.sendRedirect("/druid/index.html");
|
||||
} else {
|
||||
response.sendRedirect("druid/index.html");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (path.length() == 0 || "/".equals(path)) {
|
||||
returnResourceFile("/index.html", uri, response);
|
||||
if ("/".equals(path)) {
|
||||
response.sendRedirect("index.html");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user