diff --git a/src/main/java/com/roshka/proyectofinal/profesor/SaveServlet.java b/src/main/java/com/roshka/proyectofinal/profesor/SaveServlet.java index 8a9aeca..da4906e 100644 --- a/src/main/java/com/roshka/proyectofinal/profesor/SaveServlet.java +++ b/src/main/java/com/roshka/proyectofinal/profesor/SaveServlet.java @@ -15,20 +15,20 @@ public class SaveServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); - PrintWriter out=response.getWriter(); + PrintWriter out = response.getWriter(); - String nombre=request.getParameter("nombre"); - String apellido=request.getParameter("apellido"); - String email=request.getParameter("correo"); - String nro_cedulaStr=request.getParameter("nro_cedula"); + String nombre = request.getParameter("nombre"); + String apellido = request.getParameter("apellido"); + String email = request.getParameter("correo"); + String nro_cedulaStr = request.getParameter("nro_cedula"); int nro_cedula = Integer.parseInt(nro_cedulaStr); - Profesor p =new Profesor(nro_cedula, nombre, apellido, email); + Profesor p = new Profesor(nro_cedula, nombre, apellido, email); - int status=ProfesorDao.save(p); - if(status>0){ + int status = ProfesorDao.save(p); + if (status > 0) { out.print("
Record saved successfully!
"); request.getRequestDispatcher("formulario_profesor.jsp").include(request, response); - }else{ + } else { out.println("Sorry! unable to save record"); } diff --git a/src/main/webapp/menu.jsp b/src/main/webapp/menu.jsp index e8bc257..2fedc11 100644 --- a/src/main/webapp/menu.jsp +++ b/src/main/webapp/menu.jsp @@ -17,80 +17,27 @@ - - + + + +