问题是这样的
现在在页面1.html内通过js调用servlet,在servlet内处理完一些数据后要跳转到2.html页面上
可是不知道为什么一直都跳转不成功,还一直停留在1.html上面(servlet调用成功了)
下面是我的servlet的doGet方法
public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
response.setContentType("text/html");
//处理数据
response.sendRedirect("2.html");//这里改成http://www.baidu.com都还是停留在1.html上
}
各位帮帮忙,在线等
现在在页面1.html内通过js调用servlet,在servlet内处理完一些数据后要跳转到2.html页面上
可是不知道为什么一直都跳转不成功,还一直停留在1.html上面(servlet调用成功了)
下面是我的servlet的doGet方法
public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
response.setContentType("text/html");
//处理数据
response.sendRedirect("2.html");//这里改成http://www.baidu.com都还是停留在1.html上
}
各位帮帮忙,在线等
最好把doPost 里面也设置下doGet
doGet();//调用此方法再试试
}
调用doGet()的这个方法
在设个断点调试看看。。