Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected void processRequest(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- response.setContentType("text/html;charset=UTF-8");
- try (PrintWriter out = response.getWriter()) {
- /* TODO output your page here. You may use following sample code. */
- String Patid = request.getParameter("patientid");
- String name1 = request.getParameter("myname");
- String [] checkbok = request.getParameterValues("lang");
- for (int i = 0; i < checkbok.length; i++)
- {
- out.println("<h1>" + checkbok[i] + "</h1>");
- }
- System.out.println(Patid+name1+checkbok[1]);
- Configuration cf = new Configuration();
- cf.configure("hibernate.cfg.xml");
- SessionFactory sf = cf.buildSessionFactory();
- Session s = sf.openSession();
- Transaction t = s.beginTransaction();
- Checkb vis = new Checkb(Patid, name1, checkbok);
- s.save(vis);
- t.commit();
- s.close();
- sf.close();
- RequestDispatcher rd = request.getRequestDispatcher("login.html");
- rd.forward(request, response);
Add Comment
Please, Sign In to add comment