日期:2014-05-16 浏览次数:20369 次
//增加
?public String addBj() throws Exception
?{
??bjManager.save(bj);
??response.setContentType("text/html;charset=UTF-8");
??response.setCharacterEncoding("UTF-8");//防止弹出的信息出现乱码
??//以上2句代码一定要写在获取out对象之前,否则提示信息为乱码
?
??PrintWriter out = response.getWriter();
??out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
??out.println("<HTML>");
??out.println("? <HEAD><TITLE>A Servlet</TITLE></HEAD>");
??out.println("? <BODY>");
??out.println("<script language='JavaScript'>alert(\"添加成功!\");location.replace('xs/test/findAllBj.action');</script>");
??out.println("? </BODY>");
??out.println("</HTML>");
??out.flush();
??out.close();
??
??return null;
?}