利用jQuery传值向servlet后servlet内的定向不能跳转jsp页面 5
protectedvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServle...
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
request.setCharacterEncoding("UTF-8");
//JSONObject result=new JSONObject();
int id= Integer.valueOf(request.getParameter("id"));
StudentSer stuSer = new StudentSer();
// result.put("stu", stuSer.getStuById(id));
request.setAttribute("stu", stuSer.getStuById(id));
request.getRequestDispatcher("UpdateStudent.jsp").forward(request, response);
}
function openStudentModifyDialog(){
var selectedRows=$("#dg").datagrid('getSelections');
if(selectedRows.length!=1){
$.messager.alert("系统提示","请选择一条要编辑的数据!");
return;
}
var row=selectedRows[0];
var ID_1 = row.id;
$.post("UpdateStudentShowServlet",{id:ID_1});
} 展开
// TODO Auto-generated method stub
request.setCharacterEncoding("UTF-8");
//JSONObject result=new JSONObject();
int id= Integer.valueOf(request.getParameter("id"));
StudentSer stuSer = new StudentSer();
// result.put("stu", stuSer.getStuById(id));
request.setAttribute("stu", stuSer.getStuById(id));
request.getRequestDispatcher("UpdateStudent.jsp").forward(request, response);
}
function openStudentModifyDialog(){
var selectedRows=$("#dg").datagrid('getSelections');
if(selectedRows.length!=1){
$.messager.alert("系统提示","请选择一条要编辑的数据!");
return;
}
var row=selectedRows[0];
var ID_1 = row.id;
$.post("UpdateStudentShowServlet",{id:ID_1});
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询