Servlet内部跳转

来源:互联网 发布:java聊天室的代码 编辑:程序博客网 时间:2024/06/05 22:43

protected void init(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String _id=request.getParameter("id");
Account account=null;
int id=0;
boolean r=ValiTool.isNumber(_id)&&(id=ParseTool.strToInt(_id))>0;
if(r){
account=accountService.query(id);
}
request.setAttribute("account",account);
request.getRequestDispatcher("backsite/account/edit.jsp").forward(request, response);
}
0 0