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
0a5d285b
Commit
0a5d285b
authored
May 12, 2022
by
Jose Baez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'yovan' into 'develop'
Yovan See merge request
!9
parents
35aee765
6a53e4f2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
123 deletions
+37
-123
pom.xml
+6
-0
src/main/java/Postulante/PostulanteDao.java
+0
-34
src/main/java/Postulante/SaveServlet.java
+0
-64
src/main/java/com/roshka/proyectofinal/entity/Postulante.java
+2
-1
src/main/webapp/Javascript.js
+0
-0
src/main/webapp/formulario.html
+11
-11
src/main/webapp/index.jsp
+18
-13
No files found.
pom.xml
View file @
0a5d285b
...
...
@@ -36,6 +36,12 @@
<version>
${junit.version}
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<version>
42.3.5
</version>
</dependency>
</dependencies>
<build>
...
...
src/main/java/Postulante/PostulanteDao.java
deleted
100644 → 0
View file @
35aee765
package
Postulante
;
import
com.roshka.proyectofinal.DataBase
;
import
com.roshka.proyectofinal.Postulante
;
import
java.util.*
;
import
java.sql.*
;
public
class
PostulanteDao
{
public
static
int
save
(
Postulante
postulante
){
int
status
=
0
;
try
{
Connection
con
=
DataBase
.
getConnection
();
PreparedStatement
ps
=
con
.
prepareStatement
(
"insert into postulante(nombre,apellido,nro_cedula,correo,telefono,direccion,experiencia_laboral,estudio_universitario,notebook,bootcamp_id,aceptado) values (?,?,?,?,?,?,?,?,?,?,?)"
);
ps
.
setString
(
1
,
postulante
.
getNombre
());
ps
.
setString
(
2
,
postulante
.
getApellido
());
ps
.
setInt
(
3
,
postulante
.
getNro_cedula
());
ps
.
setString
(
4
,
postulante
.
getCorreo
());
ps
.
setString
(
5
,
postulante
.
getTelefono
());
ps
.
setString
(
6
,
postulante
.
getDireccion
());
ps
.
setBoolean
(
7
,
postulante
.
getExpLaboral
());
ps
.
setBoolean
(
8
,
postulante
.
getEstudioUniversitario
());
ps
.
setBoolean
(
9
,
postulante
.
getNotebook
());
ps
.
setInt
(
10
,
postulante
.
getBootcampId
());
ps
.
setBoolean
(
11
,
postulante
.
getAceptado
());
status
=
ps
.
executeUpdate
();
con
.
close
();
}
catch
(
Exception
ex
){
ex
.
printStackTrace
();}
return
status
;
}
}
src/main/java/Postulante/SaveServlet.java
deleted
100644 → 0
View file @
35aee765
package
Postulante
;
import
com.roshka.proyectofinal.Postulante
;
import
jakarta.servlet.ServletException
;
import
jakarta.servlet.annotation.WebServlet
;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
@WebServlet
(
"/SaveServlet"
)
public
class
SaveServlet
{
protected
void
doPost
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
response
.
setContentType
(
"text/html"
);
PrintWriter
out
=
response
.
getWriter
();
String
nombre
=
request
.
getParameter
(
"nombre"
);
String
apellido
=
request
.
getParameter
(
"apellido"
);
int
cedula
=
Integer
.
parseInt
(
request
.
getParameter
(
"cedula"
));
String
correo
=
request
.
getParameter
(
"correo"
);
String
telefono
=
request
.
getParameter
(
"telefono"
);
String
direccion
=
request
.
getParameter
(
"direccion"
);
boolean
experienciaProgramando
=
false
;
boolean
experienciaLaboral
=
false
;
boolean
universidad
=
false
;
if
(
request
.
getParameter
(
"experiencia_laboral"
)
!=
null
){
experienciaLaboral
=
true
;
}
if
(
request
.
getParameter
(
"experiencia_programando"
)
!=
null
)
{
experienciaProgramando
=
true
;
}
if
(
request
.
getParameter
(
"notebook"
)
!=
null
){
boolean
notebook
=
true
;
}
if
(
request
.
getParameter
(
"universidad"
)
!=
null
){
universidad
=
true
;
}
Postulante
postulante
=
new
Postulante
();
postulante
.
setNombre
(
nombre
);
postulante
.
setApellido
(
apellido
);
postulante
.
setNro_cedula
(
cedula
);
postulante
.
setCorreo
(
correo
);
postulante
.
setTelefono
(
telefono
);
postulante
.
setDireccion
(
direccion
);
postulante
.
setExpLaboral
(
experienciaLaboral
);
postulante
.
setEstudioUniversitario
(
universidad
);
int
status
=
PostulanteDao
.
save
(
postulante
);
if
(
status
>
0
){
out
.
print
(
"<p>Record saved successfully!</p>"
);
request
.
getRequestDispatcher
(
"index.html"
).
include
(
request
,
response
);
}
else
{
out
.
println
(
"Sorry! unable to save record"
);
}
out
.
close
();
}
}
src/main/java/entity/Postulante.java
→
src/main/java/
com/roshka/proyectofinal/
entity/Postulante.java
View file @
0a5d285b
package
com
.
roshka
.
proyectofinal
;
package
com
.
roshka
.
proyectofinal
.
entity
;
//Creacion del objeto Postulante
public
class
Postulante
{
...
...
src/main/webapp/Javascript.js
0 → 100644
View file @
0a5d285b
src/main/webapp/formulario.html
View file @
0a5d285b
...
...
@@ -16,38 +16,38 @@
<div>
<p>
Si sigues interesado y cumples con los requisitos, completa el siguiente formulario:
</p>
<form
action=
"
"
>
<form
method=
"post"
action=
"SaveServlet
"
>
<label
for=
"nombre"
>
Ingrese su Nombre:
</label>
<input
required
id=
"nombre"
type=
"text"
><br>
<input
required
id=
"nombre"
name=
"nombre"
type=
"text"
><br>
<label
for=
"apellido"
>
Ingrese su Apellido:
</label>
<input
required
id=
"apellido"
type=
"text"
><br>
<input
required
id=
"apellido"
name=
"apellido"
type=
"text"
><br>
<label
for=
"cedula"
>
Numero de cedula:
</label>
<input
required
id=
"cedula"
type=
"number"
><br>
<input
required
id=
"cedula"
name=
"cedula"
type=
"number"
><br>
<label
for=
"correo"
>
Correo:
</label>
<input
required
id=
"correo"
type=
"email"
><br>
<input
required
id=
"correo"
name=
"correo"
type=
"email"
><br>
<label
for=
"telefono"
>
Telefono:
</label>
<input
required
id=
"telefono"
type=
"text"
><br>
<input
required
id=
"telefono"
name=
"telefono"
type=
"text"
><br>
<label
for=
"direccion"
>
Direccion:
</label>
<input
required
id=
"direccion"
type=
"text"
><br>
<input
required
id=
"direccion"
name=
"direccion"
type=
"text"
><br>
<label
for=
"experiencia_laboral"
>
Experiencia laboral
</label>
<!-- Si no lo marca el valor que envia es null y si lo marca es "ON" -->
<input
id=
"experiencia_laboral"
type=
"checkbox"
><br>
<input
id=
"experiencia_laboral"
name=
"experiencia_laboral"
type=
"checkbox"
><br>
<label
for=
"experiencia_programando"
>
Tienes experiencia programando
</label>
<label
for=
"experiencia_programando"
>
Que lenguajes de programacion conoces:
</label>
<input
id=
"experiencia_programando"
type=
"checkbox"
><br>
<label
for=
"notebook"
>
Cuenta con notebook:
</label>
<input
id=
"notebook"
type=
"checkbox"
><br>
<input
id=
"notebook"
name=
"notebook"
type=
"checkbox"
><br>
<label
for=
"universidad"
>
Estudio Universitario:
</label>
<input
id=
"universidad"
type=
"checkbox"
><br>
<input
id=
"universidad"
name=
"universidad"
type=
"checkbox"
><br>
<input
type=
"submit"
>
<input
type=
"reset"
value=
"Borrar"
>
...
...
src/main/webapp/index.jsp
View file @
0a5d285b
<
%@
page
contentType=
"text/html; charset=UTF-8"
pageEncoding=
"UTF-8"
%
>
<!DOCTYPE html>
<html>
<head>
<title>
JSP - Hello World
</title>
</head>
<body>
<h1><
%=
"
Hello
World
!"
%
>
</h1>
<br/>
<a
href=
"hello-servlet"
>
Hello Servlet
</a>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>
JSP - Hello World
</title>
</head>
<body>
<h1>
<
%=
"
Hello
World
!"
%
>
</h1>
<br/>
<a
href=
"hello-servlet"
>
Hello Servlet
</a><br>
<a
href=
"./formulario.html"
>
Postulate aqui
</a>
</body>
</html>
\ No newline at end of file
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