日期:2014-05-19 浏览次数:20956 次
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try{
} catch (Exception e) {
// TODO: handle exception
request.setAttribute("e", "aaa");
System.out.println("error:"+e.getMessage());
response.sendRedirect("error.jsp");
e.printStackTrace();
}
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try{
int i = 1/0;
} catch (Exception e) {
// TODO: handle exception
request.setAttribute("e", "aaa");
System.out.println("error:"+e.getMessage());
request.getRequestDispatcher(request.getServletPath()+"/error.jsp").forward(request,response);//转发
//response.sendRedirect("error.jsp");
e.printStackTrace();
}
}
public void doPost(HttpServletRequestrequest,HttpServletResponseresponse) throws ServletException, IOException {
request.setAttribute("e", "aaa");
System.out.println("error:"+e.getMessage());
response.sendRedirect("error.jsp");
}