Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ProyectoFinal-Bootcamp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jose Baez
ProyectoFinal-Bootcamp
Commits
bf6a607f
Commit
bf6a607f
authored
May 16, 2022
by
Jose Baez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se crea vista y filtros postulante
parent
aca99328
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
1 deletions
+53
-1
src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java
+11
-0
src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
+37
-0
src/main/webapp/postulante-consulta.jsp
+5
-1
No files found.
src/main/java/com/roshka/proyectofinal/Postulante/Filtros.java
View file @
bf6a607f
...
...
@@ -36,9 +36,20 @@ public class Filtros extends HttpServlet {
@Override
protected
void
doPost
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
ServletException
,
IOException
{
String
respuesta
=
req
.
getParameter
(
"nombre"
);
if
(
respuesta
.
equals
(
"aceptado"
)){
List
<
Postulante
>
postulantes
=
listarPostulanteAceptados
();
req
.
getServletContext
().
setAttribute
(
"postulantes"
,
postulantes
);
RequestDispatcher
reqDisp
=
req
.
getRequestDispatcher
(
"postulante-consulta.jsp"
);
reqDisp
.
forward
(
req
,
resp
);
}
else
{
List
<
Postulante
>
postulantes
=
listarPorBootcamp
(
respuesta
);
req
.
getServletContext
().
setAttribute
(
"postulantes"
,
postulantes
);
RequestDispatcher
reqDisp
=
req
.
getRequestDispatcher
(
"postulante-consulta.jsp"
);
reqDisp
.
forward
(
req
,
resp
);
}
}
}
src/main/java/com/roshka/proyectofinal/Postulante/PostulanteDao.java
View file @
bf6a607f
...
...
@@ -161,4 +161,41 @@ public class PostulanteDao {
}
return
postulante
;
}
public
static
List
<
Postulante
>
listarPorBootcamp
(
String
nombre
){
List
<
Postulante
>
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
;
}
}
src/main/webapp/postulante-consulta.jsp
View file @
bf6a607f
...
...
@@ -17,9 +17,13 @@
<button
type=
"submit"
>
Buscar
</button>
</form>
<form
action=
"filtros-postulante"
method=
"post"
>
<input
type=
"hidden"
name=
"
aceptado"
value=
"si
"
>
<input
type=
"hidden"
name=
"
nombre"
value=
"aceptado
"
>
<button
type=
"submit"
>
Aceptados
</button>
</form>
<form
action=
"filtros-postulante"
method=
"post"
>
<input
type=
"search"
name=
"nombre"
placeholder=
"Buscar por Bootcamp"
>
<button
type=
"submit"
>
Bootcamp
</button>
</form>
<table>
<tr>
<th>
#
</th>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment