使用jquery代码动态行,并使用servlet代码插入行,但是它仅插入一行

时间:2018-11-05 01:10:19

标签: jquery jsp servlets

此处代码             受保护的void doPost(HttpServletRequest请求,                 HttpServletResponse响应)引发ServletException,IOException {                  request.setCharacterEncoding(“ utf-8”);                  response.setCharacterEncoding(“ utf-8”);

          here code  

         String schoolname[] = request.getParameterValues("shoolN");
         String DateFrom[] = request.getParameterValues("DateF");
         String DateTo []= request.getParameterValues("DateT");
         String Description[] = request.getParameterValues("Dscript");


          educatiodetails edu = new educatiodetails(); 

          for (int i = 0 ;i < schoolname.length ;i++){

          edu.setSchoolName(schoolname[i]+1);
          edu.setDateFrom(DateFrom[i]+1);
          edu.setDateTo(DateTo[i]+1);
          edu.setDiscriptDetails(Description[i]+1);

此处代码

          EducatiIMP education = new EducatiIMP();
          String st = education.addeducation(edu);
             if (st.equals("SUCCEED")){

             try {

                  String err = "";
                  String url = "";
                   url = "/Experiences.jsp";
                   RequestDispatcher rd = getServletContext()
                            .getRequestDispatcher(url);
                   rd.forward(request, response);

            } catch (IOException e) {
    here code 
        out.println("education file : "+e.getMessage());
                response.sendRedirect("/education.jsp");
            }

             }

          }
        }

}

0 个答案:

没有答案