代码 PrintWriter out=response.getWriter(); out.print("<script> alert('登录成功'); window.location.href='/shop/jsp/index.jsp'; </script>"); 点击确定后,跳转到主页面