Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在会话注销时,页面应重定向到login.jsp.
login.jsp
如果我使用它会重定向到 login.jsp,request.getRequestDispatcher("../login.jsp").forward(request, response)但 url 没有改变。
request.getRequestDispatcher("../login.jsp").forward(request, response)
我应该怎么做才能让它也改变url并将我重定向到登录页面?
谢谢
你需要使用
response.sendRedirect("/yourcontextPath/login.jsp);
看