protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html");
response.setCharacterEncoding("utf-8");
Category category = new Category();
category.add(new String(request.getParameter("name").getBytes("iso-8859-1"), "utf-8"));
response.getWriter().println("<script>alert('添加成功');window.location.href='admin/category.jsp'</script>");
}
我这里是用window.location.href 脚本操作返回页面。这样合理吗?
qq_遁去的一_1
相关分类