/** * 添加车费 * */ publicclassAddCfeiActionextendsHttpServlet{ /** * Constructor of the object. */ publicAddCfeiAction(){ super(); } /** * Destruction of the servlet. <br> */ publicvoiddestroy(){ super.destroy(); // Just puts "destroy" string in log // Put your code here } /** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ publicvoiddoPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); String hao=request.getParameter("hao"); String jdate=request.getParameter("jdate"); String ldate=request.getParameter("ldate");
/** * Initialization of the servlet. <br> * * @throws ServletException * if an error occurs */ publicvoidinit()throws ServletException { // Put your code here }
/** * Destruction of the servlet. <br> */ publicvoiddestroy(){ super.destroy(); // Just puts "destroy" string in log // Put your code here }
/** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ publicvoiddoPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); String name=request.getParameter("name"); String pwd=request.getParameter("pwd"); String age=request.getParameter("age"); String tel=request.getParameter("tel"); DBManager dbm = new DBManager(); //用户注册 String sql = "insert into userinfo(name,pwd,age,tel,jine) values('"+name+"','"+pwd+"','"+age+"','"+tel+"','0')";
* The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ publicvoiddoPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); String name=request.getParameter("name"); String pwd=request.getParameter("pwd"); String age=request.getParameter("age"); String tel=request.getParameter("tel"); DBManager dbm = new DBManager(); //添加用户 String sql = "insert into userinfo(name,pwd,age,tel,jine) values('"+name+"','"+pwd+"','"+age+"','"+tel+"','0')";