diff --git a/src/main/java/com/roshka/proyectofinal/LoginHandler.java b/src/main/java/com/roshka/proyectofinal/LoginHandler.java deleted file mode 100644 index 4d7999f..0000000 --- a/src/main/java/com/roshka/proyectofinal/LoginHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.roshka.proyectofinal; - -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.servlet.http.HttpSession; - -import java.io.*; - -public class LoginHandler extends HttpServlet { - - public void doPost(HttpServletRequest req, HttpServletResponse res) - throws ServletException, IOException { - res.setContentType("text/html"); - PrintWriter out = res.getWriter(); - - // Get the user's name and password - String name = req.getParameter("name"); - String passwd = req.getParameter("passwd"); - - // Check the name and password for validity - if (!allowUser(name, passwd)) { - out.println("<HTML><HEAD><TITLE>Access Denied</TITLE></HEAD>"); - out.println("<BODY>Your login and password are invalid.<BR>"); - out.println("You may want to <A HREF=\"/login.html\">try again</A>"); - out.println("</BODY></HTML>"); - } - else { - // Valid login. Make a note in the session object. - HttpSession session = req.getSession(true); - session.putValue("logon.isDone", name); // just a marker object - - // Try redirecting the client to the page he first tried to access - try { - String target = (String) session.getValue("login.target"); - if (target != null) - res.sendRedirect(target); - return; - } - catch (Exception ignored) { } - - // Couldn't redirect to the target. Redirect to the site's home page. - res.sendRedirect(req.getScheme() + "://" + - req.getServerName() + ":" + req.getServerPort()); - } - } - - protected boolean allowUser(String user, String passwd) { - return true; // trust everyone - } -} \ No newline at end of file diff --git a/src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java b/src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java new file mode 100644 index 0000000..cb976c8 --- /dev/null +++ b/src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java @@ -0,0 +1,61 @@ +package com.roshka.proyectofinal.Postulante; + +import com.roshka.proyectofinal.entity.Postulante; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import static com.roshka.proyectofinal.Postulante.PostulanteDao.*; + +@WebServlet("/filtros-postulante") +public class Filtros extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + List postulantes = listarPostulante(); + String respuesta = req.getParameter("id"); + boolean valor = Boolean.parseBoolean(req.getParameter("valor")); + String nombre = req.getParameter("nombreBuscar")== null ? "0" : req.getParameter("nombreBuscar"); + System.out.println(nombre); + if(respuesta != null) { + update(Integer.parseInt(req.getParameter("id")), valor); + postulantes = listarPostulante(); + } else if(nombre.length() > 1){ + postulantes = buscarPorNombre(nombre); + } + + req.getServletContext().setAttribute("postulantes", postulantes); + RequestDispatcher reqDisp= req.getRequestDispatcher("postulante-consulta.jsp"); + reqDisp.forward(req,resp); + } + + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + String respuesta = req.getParameter("nombre"); + + if(respuesta.equals("aceptado")){ + List postulantes = listarPostulanteAceptados(); + req.getServletContext().setAttribute("postulantes", postulantes); + RequestDispatcher reqDisp= req.getRequestDispatcher("postulante-consulta.jsp"); + reqDisp.forward(req,resp); + } else if (respuesta.equals("notebook")) { + List postulantes = buscarPorNoteBook(); + req.getServletContext().setAttribute("postulantes", postulantes); + RequestDispatcher reqDisp= req.getRequestDispatcher("postulante-consulta.jsp"); + reqDisp.forward(req,resp); + } else { + List postulantes = listarPorBootcamp(respuesta); + req.getServletContext().setAttribute("postulantes", postulantes); + RequestDispatcher reqDisp= req.getRequestDispatcher("postulante-consulta.jsp"); + reqDisp.forward(req,resp); + } + + + } +} diff --git a/src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java b/src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java index f820d82..5bc30e5 100644 --- a/src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java +++ b/src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java @@ -4,8 +4,13 @@ import com.roshka.proyectofinal.entity.Postulante; import java.sql.Connection; import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; public class PostulanteDao { + List postulante = null; public static int save(Postulante postulante){ int status=0; @@ -30,4 +35,219 @@ public class PostulanteDao { return status; } + + public static List listarPostulante(){ + List postulante = new ArrayList<>(); + String sql = "select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, a.telefono, a.direccion, " + + "a.experiencia_laboral, a.estudio_universitario, a.bootcamp_id, a.notebook, c.nombre_lenguaje as bootcamp, \n" + + "a.aceptado from postulante a\n" + + " inner join bootcamp b on b.id= a.bootcamp_id\n" + + " inner join lenguaje c on c.id=b.id_lenguaje\n" + + " order by a.id;"; + try{ + Connection con= DataBase.getConnection(); + PreparedStatement ps=con.prepareStatement(sql); + ResultSet rs = ps.executeQuery(); + while(rs.next()){ + Postulante postulanteObject = new Postulante(); + postulanteObject.setId(rs.getInt("id")); + postulanteObject.setNombre(rs.getString("nombre")); + postulanteObject.setApellido(rs.getString("apellido")); + postulanteObject.setNroCedula(rs.getInt("nro_cedula")); + postulanteObject.setCorreo(rs.getString("correo")); + postulanteObject.setTelefono(rs.getString("telefono")); + postulanteObject.setDireccion(rs.getString("direccion")); + postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral")); + postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario")); + postulanteObject.setBootcampId(rs.getInt("bootcamp_id")); + postulanteObject.setNotebook(rs.getBoolean("notebook")); + postulanteObject.setNombreBootcamp(rs.getString("bootcamp")); + postulanteObject.setAceptado(rs.getBoolean("aceptado")); + postulante.add(postulanteObject); + } + + con.close(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + return postulante; + } + + public static void update(int id, Boolean valor){ + if(valor==true){ + try{ + Connection con= DataBase.getConnection(); + PreparedStatement ps=con.prepareStatement("update postulante set aceptado= false\n" + + "where id=?"); + ps.setInt(1,id); + ps.executeUpdate(); + con.close(); + }catch(Exception ex){ + ex.printStackTrace(); + } + }else { + try{ + Connection con= DataBase.getConnection(); + PreparedStatement ps=con.prepareStatement("update postulante set aceptado= true\n" + + "where id=?"); + ps.setInt(1,id); + ps.executeUpdate(); + con.close(); + }catch(Exception ex){ + ex.printStackTrace(); + } + } + + } + + public static List buscarPorNombre(String nombre){ + List postulante = null; + Postulante postulanteObject = null; + try{ + Connection con= DataBase.getConnection(); + PreparedStatement ps=con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, " + + "a.telefono, a.direccion, a.experiencia_laboral, a.estudio_universitario, a.bootcamp_id, a.notebook, " + + "c.nombre_lenguaje as bootcamp, \n" + "a.aceptado from postulante a\n" + + " inner join bootcamp b on b.id= a.bootcamp_id\n" + + " inner join lenguaje c on c.id=b.id_lenguaje\n" + + " where a.nombre ilike ? "); + ps.setString(1, "%" + nombre + "%"); + System.out.println(nombre); + ResultSet rs = ps.executeQuery(); + postulante = new ArrayList<>(); + postulanteObject= new Postulante(); + while(rs.next()){ + + postulanteObject.setId(rs.getInt("id")); + postulanteObject.setNombre(rs.getString("nombre")); + postulanteObject.setApellido(rs.getString("apellido")); + postulanteObject.setNroCedula(rs.getInt("nro_cedula")); + postulanteObject.setCorreo(rs.getString("correo")); + postulanteObject.setTelefono(rs.getString("telefono")); + postulanteObject.setDireccion(rs.getString("direccion")); + postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral")); + postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario")); + postulanteObject.setBootcampId(rs.getInt("bootcamp_id")); + postulanteObject.setNotebook(rs.getBoolean("notebook")); + postulanteObject.setNombreBootcamp(rs.getString("bootcamp")); + postulanteObject.setAceptado(rs.getBoolean("aceptado")); + postulante.add(postulanteObject); + } + con.close(); + }catch(Exception ex){ + ex.printStackTrace(); + } + return postulante; + } + + public static List listarPostulanteAceptados(){ + List postulante = null; + try{ + Connection con= DataBase.getConnection(); + PreparedStatement ps=con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, " + + "a.telefono, a.direccion, a.experiencia_laboral, a.estudio_universitario, a.bootcamp_id, a.notebook, " + + "c.nombre_lenguaje as bootcamp, \n" + "a.aceptado from postulante a\n" + + " inner join bootcamp b on b.id= a.bootcamp_id\n" + + " inner join lenguaje c on c.id=b.id_lenguaje\n" + + " where a.aceptado= true "); + ResultSet rs = ps.executeQuery(); + postulante = new ArrayList<>(); + Postulante postulanteObject= new Postulante(); + while(rs.next()){ + postulanteObject.setId(rs.getInt("id")); + postulanteObject.setNombre(rs.getString("nombre")); + postulanteObject.setApellido(rs.getString("apellido")); + postulanteObject.setNroCedula(rs.getInt("nro_cedula")); + postulanteObject.setCorreo(rs.getString("correo")); + postulanteObject.setTelefono(rs.getString("telefono")); + postulanteObject.setDireccion(rs.getString("direccion")); + postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral")); + postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario")); + postulanteObject.setBootcampId(rs.getInt("bootcamp_id")); + postulanteObject.setNotebook(rs.getBoolean("notebook")); + postulanteObject.setNombreBootcamp(rs.getString("bootcamp")); + postulanteObject.setAceptado(rs.getBoolean("aceptado")); + postulante.add(postulanteObject); + } + con.close(); + }catch(Exception ex){ + ex.printStackTrace(); + } + return postulante; + } + + public static List listarPorBootcamp(String nombre){ + List postulante = null; + try{ + Connection con= DataBase.getConnection(); + PreparedStatement ps=con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, a.telefono, a.direccion, \n" + + " a.experiencia_laboral, a.estudio_universitario, a.bootcamp_id, a.notebook, c.nombre_lenguaje as bootcamp, \n" + + " a.aceptado from postulante a\n" + + " inner join bootcamp b on b.id= a.bootcamp_id\n" + + " inner join lenguaje c on c.id=b.id_lenguaje\n" + + " where c.nombre_lenguaje ilike ? "); + ps.setString(1, "%" + nombre + "%"); + ResultSet rs = ps.executeQuery(); + postulante = new ArrayList<>(); + Postulante postulanteObject= new Postulante(); + while(rs.next()){ + postulanteObject.setId(rs.getInt("id")); + postulanteObject.setNombre(rs.getString("nombre")); + postulanteObject.setApellido(rs.getString("apellido")); + postulanteObject.setNroCedula(rs.getInt("nro_cedula")); + postulanteObject.setCorreo(rs.getString("correo")); + postulanteObject.setTelefono(rs.getString("telefono")); + postulanteObject.setDireccion(rs.getString("direccion")); + postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral")); + postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario")); + postulanteObject.setBootcampId(rs.getInt("bootcamp_id")); + postulanteObject.setNotebook(rs.getBoolean("notebook")); + postulanteObject.setNombreBootcamp(rs.getString("bootcamp")); + postulanteObject.setAceptado(rs.getBoolean("aceptado")); + postulante.add(postulanteObject); + } + con.close(); + }catch(Exception ex){ + ex.printStackTrace(); + } + return postulante; + } + + public static List buscarPorNoteBook(){ + List postulante = null; + Postulante postulanteObject = null; + try{ + Connection con= DataBase.getConnection(); + PreparedStatement ps=con.prepareStatement("select a.id, a.nombre, a.apellido, a.nro_cedula, a.correo, " + + "a.telefono, a.direccion, a.experiencia_laboral, a.estudio_universitario, a.bootcamp_id, a.notebook, " + + "c.nombre_lenguaje as bootcamp, \n" + "a.aceptado from postulante a\n" + + " inner join bootcamp b on b.id= a.bootcamp_id\n" + + " inner join lenguaje c on c.id=b.id_lenguaje\n" + + " where a.notebook=true "); + ResultSet rs = ps.executeQuery(); + postulante = new ArrayList<>(); + postulanteObject= new Postulante(); + while(rs.next()){ + + postulanteObject.setId(rs.getInt("id")); + postulanteObject.setNombre(rs.getString("nombre")); + postulanteObject.setApellido(rs.getString("apellido")); + postulanteObject.setNroCedula(rs.getInt("nro_cedula")); + postulanteObject.setCorreo(rs.getString("correo")); + postulanteObject.setTelefono(rs.getString("telefono")); + postulanteObject.setDireccion(rs.getString("direccion")); + postulanteObject.setExpLaboral(rs.getBoolean("experiencia_laboral")); + postulanteObject.setEstudioUniversitario(rs.getBoolean("estudio_universitario")); + postulanteObject.setBootcampId(rs.getInt("bootcamp_id")); + postulanteObject.setNotebook(rs.getBoolean("notebook")); + postulanteObject.setNombreBootcamp(rs.getString("bootcamp")); + postulanteObject.setAceptado(rs.getBoolean("aceptado")); + postulante.add(postulanteObject); + } + con.close(); + }catch(Exception ex){ + ex.printStackTrace(); + } + return postulante; + } } diff --git a/src/main/java/com/roshka/proyectofinal/Postulante/SaveServlet.java b/src/main/java/com/roshka/proyectofinal/Postulante/SaveServlet.java index 75e1d60..58947ae 100644 --- a/src/main/java/com/roshka/proyectofinal/Postulante/SaveServlet.java +++ b/src/main/java/com/roshka/proyectofinal/Postulante/SaveServlet.java @@ -80,13 +80,27 @@ public class SaveServlet extends HttpServlet { } int status=PostulanteDao.save(postulante); if(status>0){ - out.print("

Record saved successfully!

"); - request.getRequestDispatcher("index.html").include(request, response); + //out.print("

Record saved successfully!

"); + out.print("
\n" + + " × \n" + + " Formulario Cargado! EXITOSAMENTE CARGADO\n" + + "
"); + request.getRequestDispatcher("formulario.jsp").include(request, response); }else{ if (rechazarDatos){ - out.println("El correo ingresado ya esta registrado para el bootcamp actual"); + //out.println("El correo ingresado ya esta registrado para el bootcamp actual"); + out.print("
\n" + + " × \n" + + " Formulario ya Cargado! YA EXISTE EL FORMULARIO\n" + + "
"); + request.getRequestDispatcher("formulario.jsp").include(request, response); }else { - out.println("Sorry! unable to save record"); + out.println("Error al cargar datos"); + out.print("
\n" + + " × \n" + + " Formulario ya Cargado! YA EXISTE EL FORMULARIO\n" + + "
"); + request.getRequestDispatcher("formulario.jsp").include(request, response); } } diff --git a/src/main/java/com/roshka/proyectofinal/entity/Postulante.java b/src/main/java/com/roshka/proyectofinal/entity/Postulante.java index 459696f..dd21dc7 100644 --- a/src/main/java/com/roshka/proyectofinal/entity/Postulante.java +++ b/src/main/java/com/roshka/proyectofinal/entity/Postulante.java @@ -5,6 +5,7 @@ package com.roshka.proyectofinal.entity; public class Postulante { private int id,nroCedula,bootcampId; + private String nombreBootcamp; private String nombre,apellido,telefono,direccion,correo; private boolean expLaboral,estudioUniversitario,notebook,aceptado; @@ -27,6 +28,22 @@ public class Postulante { this.bootcampId = bootcampId; this.aceptado = aceptado; } + + public Postulante(int nroCedula, String nombreBootcam, String nombre, String apellido, String telefono, String direccion, String correo, boolean expLaboral, boolean estudioUniversitario, boolean notebook, int bootcampId, boolean aceptado) { + this.nroCedula = nroCedula; + this.nombreBootcamp = nombreBootcam; + this.nombre = nombre; + this.apellido = apellido; + this.telefono = telefono; + this.direccion = direccion; + this.correo = correo; + this.expLaboral = expLaboral; + this.estudioUniversitario = estudioUniversitario; + this.notebook = notebook; + this.bootcampId = bootcampId; + this.aceptado = aceptado; + } + public int getId() { return id; } @@ -97,4 +114,39 @@ public class Postulante { this.bootcampId = bootcampId; } + public void setId(int id) { + this.id = id; + } + + public int getNroCedula() { + return nroCedula; + } + + public void setNroCedula(int nroCedula) { + this.nroCedula = nroCedula; + } + + public String getNombreBootcamp() { + return nombreBootcamp; + } + + public void setNombreBootcamp(String nombreBootcamp) { + this.nombreBootcamp = nombreBootcamp; + } + + public boolean isExpLaboral() { + return expLaboral; + } + + public boolean isEstudioUniversitario() { + return estudioUniversitario; + } + + public boolean isNotebook() { + return notebook; + } + + public boolean isAceptado() { + return aceptado; + } } diff --git a/src/main/java/com/roshka/proyectofinal/login/LoginServlet.java b/src/main/java/com/roshka/proyectofinal/login/LoginServlet.java index 5791d80..7d797f9 100644 --- a/src/main/java/com/roshka/proyectofinal/login/LoginServlet.java +++ b/src/main/java/com/roshka/proyectofinal/login/LoginServlet.java @@ -1,30 +1,24 @@ package com.roshka.proyectofinal.login; - - import java.io.IOException; import java.io.PrintWriter; import java.security.NoSuchAlgorithmException; - +import jakarta.servlet.RequestDispatcher; import jakarta.servlet.ServletException; import jakarta.servlet.annotation.WebServlet; import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; - import com.roshka.proyectofinal.entity.LoginBean; import com.roshka.proyectofinal.login.md5JavaHash; import jakarta.servlet.http.HttpSession; - import static java.lang.System.out; - /** * Servlet implementation class LoginServlet */ @WebServlet("/login") public class LoginServlet extends HttpServlet { private static final long serialVersionUID = 1L; - /** * @see HttpServlet#HttpServlet() */ @@ -48,6 +42,7 @@ public class LoginServlet extends HttpServlet { LoginDao loginDao = new LoginDao(); md5JavaHash passEncrip = new md5JavaHash(); String passwordMD5 = ""; + response.setContentType("text/html"); PrintWriter out = response.getWriter(); String username = request.getParameter("username"); @@ -60,42 +55,43 @@ public class LoginServlet extends HttpServlet { } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } - out.println(passwordMD5); loginBean.setPassword(passwordMD5); loginBean.setCorreo(correo); - out.println("EL pass encriptado es: " +passwordMD5); + //out.println("EL pass encriptado es: " +passwordMD5); if (loginDao.validate(loginBean)) { HttpSession session = request.getSession(true); //incluir nota de sesion valida - session.setAttribute("logon.isDone", username); - - + session.setAttribute("logon.isDone", correo); + //out.print ("Bienvenido " + correo); // Tratar de re-dirigir a la pagina que el usuario quiso acceder try { String target = (String) session.getAttribute("login.target"); - response.sendRedirect("loginSuccess.jsp"); + //response.sendRedirect("loginSuccess.jsp"); + //out.println(" \n Destino: " + target); if (target != null) response.sendRedirect(target); - return; + //return; } catch (Exception ignored) { } // Si no es posible redireccionar a la pagina solicitada, llevar a la main page - //response.sendRedirect(request.getScheme() + "://" + - // request.getServerName() + ":" + request.getServerPort()); - System.out.println("redirigir al index.html"); + RequestDispatcher rd = request.getRequestDispatcher("menu.html"); + rd.include(request,response); } else { //si no es un user valido - mandar error y redireccionar al inicio de sesion + RequestDispatcher rd = request.getRequestDispatcher("/login.jsp"); + //out.print("
Credenciales incorrectas! Reintente ...
"); + rd.include(request,response); - out.println("

You may want to try again

"); -// request.getRequestDispatcher("login.jsp").include(request, response); -// response.sendRedirect("login.jsp"); } + + + } diff --git a/src/main/java/com/roshka/proyectofinal/login/LogoutServlet.java b/src/main/java/com/roshka/proyectofinal/login/LogoutServlet.java new file mode 100644 index 0000000..aef98ec --- /dev/null +++ b/src/main/java/com/roshka/proyectofinal/login/LogoutServlet.java @@ -0,0 +1,48 @@ +package com.roshka.proyectofinal.login; +import java.io.IOException; +import java.io.PrintWriter; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; + + +/** + * Servlet implementation class LoginServlet + */ +@WebServlet("/logout") +public class LogoutServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + /** + * @see HttpServlet#HttpServlet() + */ + public LogoutServlet() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + //response.getWriter().append("Served at: ").append(request.getContextPath()); + + response.setContentType("text/html"); + PrintWriter out = response.getWriter(); + //out.print("Has cerrado tu sesion !"); + + request.getRequestDispatcher("index.html").include(request,response); + + HttpSession session = request.getSession(true); + session.invalidate(); + + + + out.close(); + } + +} \ No newline at end of file diff --git a/src/main/java/com/roshka/proyectofinal/ProtectedResource.java b/src/main/java/com/roshka/proyectofinal/login/ProtectedResource.java similarity index 89% rename from src/main/java/com/roshka/proyectofinal/ProtectedResource.java rename to src/main/java/com/roshka/proyectofinal/login/ProtectedResource.java index eab9085..980e356 100644 --- a/src/main/java/com/roshka/proyectofinal/ProtectedResource.java +++ b/src/main/java/com/roshka/proyectofinal/login/ProtectedResource.java @@ -1,10 +1,13 @@ -package com.roshka.proyectofinal; +package com.roshka.proyectofinal.login; import java.io.*; import java.util.*; import jakarta.servlet.*; +import jakarta.servlet.annotation.WebServlet; import jakarta.servlet.http.*; +@WebServlet("/protected") + public class ProtectedResource extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { @@ -22,7 +25,7 @@ public class ProtectedResource extends HttpServlet { session.setAttribute("login.target", HttpUtils.getRequestURL(req).toString()); res.sendRedirect(req.getScheme() + "://" + req.getServerName() + ":" - + req.getServerPort() + "/login.jsp"); + + req.getServerPort() + "/finalProyect2/login.jsp"); return; } // El usuario se loggeo y puede ver el recurso diff --git a/src/main/webapp/estilos/form.css b/src/main/webapp/estilos/form.css new file mode 100644 index 0000000..4b99993 --- /dev/null +++ b/src/main/webapp/estilos/form.css @@ -0,0 +1,124 @@ +/* el header donde va el logo y el menu */ +html,body{ + background-image: url(imagenes/descarga.svg); + +} +/* damos los estilos a todo lo que contiene el body */ +body{ + background-color: rgba(11, 49, 110, 0.75); + font-family:Calibri, Candara, Segoe, Segoe UI, Optima, Arial, sans-serif; + color: wheat; + font-weight: bold; + display: flex; + justify-content: center; + align-items: center; + height: 160%;} + +} +/* para el logo */ +img{ + width: 165px; + padding: 10px; +} + +p.enter{ + text-align: center; + font-size: 20px; +} +/* para el parrafo */ +p:hover{ + color: yellow; +} + +/* para el create o sea para el main */ +.create{ + width: 100%; + max-width: 785px; + min-width: 320px; + border-radius: 15px; + background-color: rgba(11, 49, 110, 0.75); + padding: 1rem; + +} +/* contenedor */ +/* para el forrmulario */ +.form label{ + + display: block; + border: none; + + align-items:center; + + +} + +.form input{ + display: block; + border: none; + width: 50%; + align-items:center; +} +.form input[type="email"],.form input[type="text"],.form input[type="number"]{ + background-color: transparent; + border-radius: 10px; + border: 1px solid #000; + +} +.form input:hover{ + background-color: wheat; +} + + + +a{ + text-decoration: none; +} +ul{ +list-style:none; +font-size:15px; +} + +a{ +text-decoration:none; +color:black; +background-color: #21211d; +border-radius: 10px; + color: #FFF; + padding: 10px; + margin:15px; + text-decoration: none; + cursor: pointer; + background-image: url(imagenes/descarga.svg); +} + .form input[type="reset"] , .form input[type="submit"]{ + text-decoration:none; + background-color: rgba(11, 49, 110, 0.75); + background-image: url(imagenes/descarga.svg); + border-radius: 10px;; + padding: 15px; + border-radius: 10px; + text-decoration: none; + color:#ffff; + text-align:left; + cursor: pointer; + width:80px; + text-align:center; + } + + +input#ruby,input#python,input#c,input#javascript,input#java{ +width:20px; + +} +input#experiencia_laboral,input#notebook,input#universidad{ +width:100px; +} + + + + + +/* parrafo final */ +//mi parte jose leeme + + diff --git a/src/main/webapp/formulario.jsp b/src/main/webapp/formulario.jsp index 787dbd1..b080e1a 100644 --- a/src/main/webapp/formulario.jsp +++ b/src/main/webapp/formulario.jsp @@ -1,13 +1,4 @@ - + <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> @@ -15,19 +6,28 @@ pageEncoding="UTF-8"%> - - JSP Page + + + + + + Formulario Postulante -
- +
+ +
+
+
-

Si sigues interesado y cumples con los requisitos, completa el siguiente formulario:

+

Si sigues interesado y cumples con los requisitos, completa el siguiente formulario:

-
+ - +
@@ -45,10 +45,6 @@ pageEncoding="UTF-8"%>
- - -
-

Lenguajes de programacion que conoces:

<%@ page import="com.roshka.proyectofinal.entity.Lenguaje, com.roshka.proyectofinal.lenguaje.LenguajeDao, java.util.List,java.util.Iterator" %> @@ -65,8 +61,8 @@ pageEncoding="UTF-8"%> len = iter.next(); %> -
  • - id= +
  • + id= <%=len.getNombre_lenguaje() %> name= <%=len.getNombre_lenguaje() %> type="checkbox">
  • @@ -74,19 +70,189 @@ pageEncoding="UTF-8"%> <% } %> +
  • + +
  • + +
    +

    Lenguajes de programacion que conoces:

    - -
    + +
    - +
    - - + +
    + + +
    + volver +
    -
    + +
    +
    + + + + + \ No newline at end of file diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index 3d7c70d..927fbe3 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -16,6 +16,7 @@ Roshka WebSite +
    - +
    diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index a026d71..1e89b6c 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -14,6 +14,10 @@
    Hello Servlet
    + LOGIN
    + LOGOUT
    + RECUSO PROTEGIDO
    + diff --git a/src/main/webapp/login.jsp b/src/main/webapp/login.jsp index 7f1d2ed..617d2b9 100644 --- a/src/main/webapp/login.jsp +++ b/src/main/webapp/login.jsp @@ -1,21 +1,48 @@ -<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> - - - - BootcampsLogin - - -
    -

    User Login Form

    -
    - - - + - -
    Correo:
    Password:
    -
    +
    +
    + + +
    + +
    + +
    +

    Need Help?

    +

    +
    + + +
    + +
    +
    diff --git a/src/main/webapp/menu.html b/src/main/webapp/menu.html index f8a55bf..cf383e3 100644 --- a/src/main/webapp/menu.html +++ b/src/main/webapp/menu.html @@ -81,7 +81,7 @@ a{