这是servlet里面的部分内容:
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {//request.getRequestDispatcher("hehe.jsp").forward(request, response);
System.out.println(request.getParameter("username")+"-----"+request.getParameter("content"));
response.setContentType("text/html; charset=utf-8");
response.sendRedirect("test.html");
return;
}
这是某jsp页面的js部分内容:
$("tr:first").click(function(){
alert("hehe");
$.post("Test",{
username : "aaaaa" ,
content : "hehehehehe"
});
});
点击了对应的部分之后,myselipse输出如下;(第二行内容)
信息: Server startup in 816 ms
aaaaa-----hehehehehe
由此说明我数据都传过来了,为何浏览器没有重定向到test.html呢?
求大神解答orz。。。。