Roles y User al 90%:

-Front-End Completo.
-Falta conectar Roles con Access
-Errores menores
master
Araozu 2018-06-15 19:36:18 -05:00
parent 55ef3eb2ef
commit 874c45b5b4
1 changed files with 14 additions and 10 deletions

View File

@ -15,6 +15,19 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import java.io.IOException; 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") @SuppressWarnings("serial")
public class RolesControllerAdd extends HttpServlet { public class RolesControllerAdd extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
@ -28,6 +41,7 @@ public class RolesControllerAdd extends HttpServlet {
action = ""; action = "";
switch (action){ switch (action){
//Crea
case "create": case "create":
String name = request.getParameter("roleName"); String name = request.getParameter("roleName");
@ -63,16 +77,6 @@ public class RolesControllerAdd extends HttpServlet {
break; 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(); pm.close();