STS的response.sendRedirect方法跳转不了
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html;charset=UTF-8");
String username=request.getParameter("username");
String password=request.getParameter("password");
if(("111").equals(username)&&("111").equals(password)){
response.sendRedirect("/request/1.html");
}else{
response.sendRedirect("/request/2.html");
}
2.HTML是表单,如果账号和密码正确跳转到1.HTML
结果就是提交表单不能跳转到1.html