您需要
Location手动设置响应状态和标题。
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);response.setHeader("Location", "http://somewhere/");将状态设置为之前
sendRedirect()将无效,否则
sendRedirect()将其设置为
SC_FOUND之后。

您需要
Location手动设置响应状态和标题。
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);response.setHeader("Location", "http://somewhere/");将状态设置为之前
sendRedirect()将无效,否则
sendRedirect()将其设置为
SC_FOUND之后。