我正在研究Jhipster项目版本0.11.1。在这个版本中,我已经打开了来自StaticResourcesProductionFilter.java的映射,从打开的两页打开" /" url,即索引页面和主页,它在版本0.11.1中正常工作。
HttpServletRequest httpRequest = (HttpServletRequest) request;
String contextPath = ((HttpServletRequest) request).getContextPath();
String requestURI = httpRequest.getRequestURI();
requestURI = StringUtils.substringAfter(requestURI, contextPath);
if (StringUtils.equals("/", requestURI)) {
Authentication auth =SecurityContextHolder.getContext().getAuthentication();
String name = auth.getName();
if(name.equal("anonymousUser")){
requestURI = "/index.html";
}else{
requestURI = "/home.html";
}
}
String newURI = "/dist" + requestURI;
request.getRequestDispatcher(newURI).forward(request, response);
但现在我已将其更新为0.18.1。现在我们的代码再次重新加载index.html而不是home.html,即无限重新加载index.html页面。
请帮帮我。