From 874c45b5b4f67994de6e26a1b68dc2e5242c9054 Mon Sep 17 00:00:00 2001 From: Araozu Date: Fri, 15 Jun 2018 19:36:18 -0500 Subject: [PATCH] Roles y User al 90%: -Front-End Completo. -Falta conectar Roles con Access -Errores menores --- src/controller/roles/RolesControllerAdd.java | 24 ++++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/controller/roles/RolesControllerAdd.java b/src/controller/roles/RolesControllerAdd.java index f7e80b4..31c9cdd 100644 --- a/src/controller/roles/RolesControllerAdd.java +++ b/src/controller/roles/RolesControllerAdd.java @@ -15,6 +15,19 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; +/** + * RolesControllerAdd + * + * Permite lo siguiente: + * + * Crear un Rol -> con el parametro action = create + * Redireccionar al form para crear un Rol -> parametro action = redirect + * Actualizar un Rol -> parametro action = update + * + * + * + * */ + @SuppressWarnings("serial") public class RolesControllerAdd extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { @@ -28,6 +41,7 @@ public class RolesControllerAdd extends HttpServlet { action = ""; switch (action){ + //Crea case "create": String name = request.getParameter("roleName"); @@ -63,16 +77,6 @@ public class RolesControllerAdd extends HttpServlet { break; - case "delete": - - a = KeyFactory.stringToKey(request.getParameter("key")); - - try{ - pm.deletePersistent(pm.getObjectById(Role.class, a)); - } catch (JDOObjectNotFoundException e){ - e.printStackTrace(); - } - break; } pm.close();