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
799fa838
Commit
799fa838
authored
May 16, 2022
by
Yovan Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coexion entre paginas y validacion de carga de postulantes
parent
bd9b5ea9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
160 deletions
+60
-160
src/main/java/com/roshka/proyectofinal/Postulante/EditServletPostulante.java
+0
-49
src/main/java/com/roshka/proyectofinal/Postulante/SaveServlet.java
+3
-3
src/main/java/com/roshka/proyectofinal/Postulante/ViewServletPostulantes.java
+0
-60
src/main/webapp/bootcamp.jsp
+33
-43
src/main/webapp/formulario.jsp
+21
-1
src/main/webapp/index.html
+1
-1
src/main/webapp/manage_postulantes.jsp
+2
-3
No files found.
src/main/java/com/roshka/proyectofinal/Postulante/EditServletPostulante.java
deleted
100644 → 0
View file @
bd9b5ea9
package
com
.
roshka
.
proyectofinal
.
Postulante
;
import
com.roshka.proyectofinal.DataBase
;
import
com.roshka.proyectofinal.entity.Postulante
;
import
com.roshka.proyectofinal.entity.Bootcamp
;
import
com.roshka.proyectofinal.entity.PostulanteLenguaje
;
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
javafx.geometry.Pos
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.sql.*
;
import
java.util.List
;
@WebServlet
(
"/EditServletPostulante"
)
public
class
EditServletPostulante
extends
HttpServlet
{
protected
void
doPost
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
response
.
setContentType
(
"text/html"
);
PrintWriter
out
=
response
.
getWriter
();
String
sid
=
request
.
getParameter
(
"id"
);
boolean
accion
;
if
(
request
.
getParameter
(
"value"
)
==
"Rechazar"
)
{
accion
=
false
;
}
else
{
accion
=
true
;
}
int
id
=
Integer
.
parseInt
(
sid
);
Postulante
e
=
new
Postulante
();
e
.
setId
(
id
);
e
.
setAceptado
(
accion
);
int
status
=
PostulanteDao
.
update
(
e
);
if
(
status
>
0
)
{
response
.
sendRedirect
(
"ViewServlet"
);
}
else
{
out
.
println
(
"Sorry! unable to update record"
);
}
out
.
close
();
}
}
src/main/java/com/roshka/proyectofinal/Postulante/SaveServlet.java
View file @
799fa838
...
...
@@ -24,7 +24,7 @@ public class SaveServlet extends HttpServlet {
response
.
setContentType
(
"text/html"
);
PrintWriter
out
=
response
.
getWriter
();
boolean
rechazarDatos
=
false
;
int
bootcampActual
=
2
;
int
bootcampActual
=
Integer
.
parseInt
(
request
.
getParameter
(
"bootcamp_id"
))
;
try
{
Connection
con
=
DataBase
.
getConnection
();
...
...
@@ -116,11 +116,11 @@ public class SaveServlet extends HttpServlet {
out
.
println
(
"<a href=formulario.jsp >Volver al cuestionario</a>"
);
}
else
{
out
.
println
(
"<p>El correo ingresado ya esta registrado para el bootcamp actual<p>"
);
request
.
getRequestDispatcher
(
""
).
include
(
request
,
response
);
//
request.getRequestDispatcher("").include(request, response);
}
}
else
{
out
.
println
(
"Error"
);
out
.
println
(
"<script> window.alert('Falla al enviar la postulacion,Intente de nuevo') </script>"
);
//
out.println("<script> window.alert('Falla al enviar la postulacion,Intente de nuevo') </script>");
}
}
...
...
src/main/java/com/roshka/proyectofinal/Postulante/ViewServletPostulantes.java
deleted
100644 → 0
View file @
bd9b5ea9
package
com
.
roshka
.
proyectofinal
.
Postulante
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.util.List
;
import
com.roshka.proyectofinal.DataBase
;
import
com.roshka.proyectofinal.entity.Postulante
;
import
com.roshka.proyectofinal.entity.Bootcamp
;
import
com.roshka.proyectofinal.entity.PostulanteLenguaje
;
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
javafx.geometry.Pos
;
import
com.roshka.proyectofinal.DataBase
;
import
com.roshka.proyectofinal.entity.Postulante
;
import
com.roshka.proyectofinal.entity.Bootcamp
;
import
com.roshka.proyectofinal.entity.PostulanteLenguaje
;
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.io.PrintWriter
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.Statement
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.sql.*
;
import
java.util.List
;
@WebServlet
(
"/ViewServletPostulante"
)
public
class
ViewServletPostulantes
extends
HttpServlet
{
protected
void
doGet
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
response
.
setContentType
(
"text/html"
);
PrintWriter
out
=
response
.
getWriter
();
out
.
println
(
"<h1>Lista de Postulantes</h1>"
);
List
<
Postulante
>
list
=
PostulanteDao
.
ListarPostulantes
();
out
.
print
(
"<table border='1' width='100%'"
);
out
.
print
(
"<tr><th>Id</th><th>Nombre</th><th>Apellido</th><th>Email</th><th>Direccion</th> <th>Edit</th><th>Delete</th></tr>"
);
for
(
Postulante
e:
list
){
out
.
print
(
"<tr><td>"
+
e
.
getId
()+
"</td><td>"
+
e
.
getNombre
()+
"</td><td>"
+
e
.
getApellido
()+
"</td> <td>"
+
e
.
getCorreo
()+
"</td><td>"
+
e
.
getDireccion
()+
"</td><td><a href='EditServlet?id="
+
e
.
getId
()+
"'>edit</a></td> <td><a href='DeleteServlet?id="
+
e
.
getId
()+
"'>delete</a></td></tr>"
);
}
out
.
print
(
"</table>"
);
out
.
close
();
}
}
src/main/webapp/bootcamp.
html
→
src/main/webapp/bootcamp.
jsp
View file @
799fa838
<!doctype html>
<html
lang=
"en"
>
<
%@
page
language=
"java"
contentType=
"text/html; charset=UTF-8"
pageEncoding=
"UTF-8"
%
>
<
%@
page
import=
"java.sql.*,java.sql.Connection,java.sql.ResultSet,com.roshka.proyectofinal.DataBase"
%
>
<!doctype html>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Bootcamp
</title>
...
...
@@ -443,10 +446,10 @@
<script
async
src=
"https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6907191851278817"
crossorigin=
"anonymous"
></script>
</head>
</head>
<body>
<body>
<div
class=
"col-lg-7 mx-auto mt-5 mb-5"
>
<h3
class=
"h3 mt-5"
>
¿QUE ES UN BOOTCAMP?
</h3>
...
...
@@ -516,51 +519,37 @@
<div
class=
"row"
>
<
%
Connection
con =
DataBase.getConnection();
Statement
stmt =
con.createStatement();
ResultSet
rs =
stmt.executeQuery("SELECT
*
FROM
bootcamp
WHERE
activo=
true");
while
(
rs
.
next
()){
%
>
<div
class=
"col-lg-7 mx-auto mb-2"
>
<div
class=
"card card-h mb-4"
>
<img
src=
"https://zetsan.com/wp-content/uploads/2020/10/1366_2000.jpeg"
lazyload
alt=
" "
>
<img
src=
"https://zetsan.com/wp-content/uploads/2020/10/1366_2000.jpeg"
lazyload
alt=
<%=rs.getString(
"
titulo
")
%
>
>
<div
class=
"card-body "
>
<p
class=
"mb-1 "
>
BOOTCAMP JAVA
</p>
<p
class=
"mb-1 "
>
Inicio: 18/04/2023
</p>
<p
class=
"mb-1 "
>
Fin: 18/05/2023
</p>
<p
class=
"mb-1 "
>
<
%=
rs
.
getString
("
titulo
")
%
>
</p>
<p
class=
"mb-1 "
>
Inicio:
<
%=
rs
.
getString
("
fecha_inicio
")%
>
</p>
<p
class=
"mb-1 "
>
Fin:
<
%=
rs
.
getString
("
fecha_fin
")%
>
</p>
<form
action=
"formulario.jsp"
>
<input
type=
"submit "
value=
"POSTULAR "
/>
<input
name=
"bootcamp"
type=
"hidden"
value=
<%=rs.getInt(
"
id
")
%
>
>
<button
type=
"submit"
>
POSTULAR
</button>
</form>
</div>
</div>
</div>
<div
class=
"col-lg-7 mx-auto mb-2 "
>
<div
class=
"card card-h mb-4 "
>
<img
src=
"https://www.pngmart.com/files/13/Android-Logo-PNG-File.png "
class=
"card-img-top lazyload "
alt=
"Learning Web Design: A Beginner 's Guide to HTML, CSS, JavaScript, and Web Graphics"
>
<div
class=
"card-body"
>
<p
class=
"mb-1"
>
BOOTCAMP ANDROID
</p>
<p
class=
"mb-1"
>
Inicio: 18/06/2023
</p>
<p
class=
"mb-1"
>
Fin: 18/07/2023
</p>
<form
action=
"formulario.jsp"
>
<input
type=
"submit"
value=
"POSTULAR"
/>
</form>
</div>
</div>
<
%
}
%
>
</div>
<div
class=
"col-lg-7 mx-auto mb-2"
>
<div
class=
"card card-h mb-4"
>
<img
src=
"https://p4.wallpaperbetter.com/wallpaper/710/859/671/technology-apple-ios-12-wallpaper-preview.jpg"
lazyload
"
alt=
" "
>
<div
class=
"card-body "
>
<p
class=
"mb-1 "
>
BOOTCAMP iOS
</p>
<p
class=
"mb-1 "
>
Inicio: 18/08/2023
</p>
<p
class=
"mb-1 "
>
Fin: 18/09/2023
</p>
<form
action=
"formulario.jsp "
>
<input
type=
"submit "
value=
"POSTULAR "
/>
</form>
</div></div>
</div>
</div>
</body>
</body>
</div>
</div>
...
...
@@ -569,4 +558,5 @@
</body>
</html>
\ No newline at end of file
</html>
\ No newline at end of file
src/main/webapp/formulario.jsp
View file @
799fa838
<
%@
page
language=
"java"
contentType=
"text/html; charset=UTF-8"
pageEncoding=
"UTF-8"
%
>
<
%@
page
import=
"java.sql.*,java.sql.Connection,java.sql.ResultSet,com.roshka.proyectofinal.DataBase,jakarta.servlet.http.HttpServlet,jakarta.servlet.http.HttpServletRequest"
%
>
<!DOCTYPE html>
<html>
...
...
@@ -11,6 +13,7 @@ pageEncoding="UTF-8"%>
<link
href=
"estilos/form.css"
rel=
"stylesheet"
type=
"text/css"
/>
<link
rel=
"shortcut icon"
href=
"imagenes/roshkaicon.ico"
sizes=
"any"
/>
<link
rel=
"stylesheet"
media=
"(max-width: 800px)"
href=
"example.css"
/>
<link
href=
"https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css"
rel=
"stylesheet"
integrity=
"sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor"
crossorigin=
"anonymous"
>
<title>
Formulario Postulante
</title>
</head>
...
...
@@ -24,11 +27,28 @@ pageEncoding="UTF-8"%>
<main
class=
"create"
>
<article
class=
"contenedor"
>
<div>
<
%
int
id =
Integer.parseInt(request.getParameter("bootcamp"));
System
.
out
.
print
("
hola
"+
id
);
Connection
con =
DataBase.getConnection();
Statement
stmt =
con.createStatement();
ResultSet
rs =
stmt.executeQuery("SELECT
*
FROM
bootcamp
WHERE
id=
"+id+ "
LIMIT
1
"
);
rs
.
next
();
%
>
<h2>
Descripcion:
</h2>
<p>
<
%=
rs
.
getString
("
descripcion
")
%
>
</p>
<p
class=
"enter"
>
Si sigues interesado y cumples con los requisitos, completa el siguiente formulario:
</p>
<form
method=
"post"
action=
"SaveServlet"
class=
"form"
>
<input
type=
"hidden"
name=
"bootcamp_id"
value=
"<%= request.getParameter("
bootcamp
")
%
>
">
<label
for=
"nombre"
>
Ingrese su Nombre:
</label>
<input
required
id=
"nombre"
name=
"nombre"
type=
"text"
><br>
...
...
@@ -60,7 +80,7 @@ pageEncoding="UTF-8"%>
<
%
while
(
iter
.
hasNext
()){
len =
iter.next();
%
>
<li
>
<li
class=
"d-flex"
>
<label
for=
<%=len.getNombre_lenguaje()
%
>
>
<
%=
len
.
getNombre_lenguaje
()
%
>
</label>
<input
onclick=
"enviar(id)"
value=
<%=len.getId()
%
>
id=
<
%=
len
.
getNombre_lenguaje
()
%
>
name=
...
...
src/main/webapp/index.html
View file @
799fa838
...
...
@@ -24,7 +24,7 @@
<div
class=
"menu"
>
<ul>
<li
class=
"link-menu"
><a
href=
""
>
Home
</a></li>
<li
class=
"link-menu"
><a
href=
"
formulario
.jsp"
>
Postulate
</a></li>
<li
class=
"link-menu"
><a
href=
"
bootcamp
.jsp"
>
Postulate
</a></li>
<li
class=
"link-menu"
><a
href=
"formulario_bootcamp.jsp"
>
Crear bootcamp
</a></li>
<li
class=
"link-menu"
><a
href=
"manage_postulantes.jsp"
>
Manage Postulantes(perdon angel)
</a></li>
</ul>
...
...
src/main/webapp/manage_postulantes.jsp
View file @
799fa838
...
...
@@ -82,8 +82,7 @@ pageEncoding="UTF-8"%>
</td>
<td>
<form
method=
"post"
action=
"EditServletPostulante"
>
<input
type=
"hidden"
value=
<%
%
>
id=
<
%=
rs
.
getInt
(
"
id
")
%
>
>
<input
type=
"hidden"
value=
"<%=rs.getInt('id') %>"
>
<
%
String
accion =
""
;
if
(
rs
.
getBoolean
("
aceptado
")){
...
...
@@ -92,7 +91,7 @@ pageEncoding="UTF-8"%>
accion=
"Aceptar"
;
}
%
>
<input
type=
"submit
"
value=
<%=accion
%
>
<input
type=
"submit"
name=
"
"
value=
<%=accion
%
>
<a
href=
""
></a>
</form>
...
...
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