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
a48a7f23
Commit
a48a7f23
authored
May 17, 2022
by
Yovan Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Arreglado mensaje de envio de formulario postulante
parent
37137d0f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
15 deletions
+29
-15
src/main/java/com/roshka/proyectofinal/Postulante/SaveServlet.java
+26
-12
src/main/webapp/formulario.jsp
+2
-2
src/main/webapp/index.html
+1
-1
No files found.
src/main/java/com/roshka/proyectofinal/Postulante/SaveServlet.java
View file @
a48a7f23
...
@@ -4,6 +4,7 @@ import com.roshka.proyectofinal.DataBase;
...
@@ -4,6 +4,7 @@ import com.roshka.proyectofinal.DataBase;
import
com.roshka.proyectofinal.entity.Postulante
;
import
com.roshka.proyectofinal.entity.Postulante
;
import
com.roshka.proyectofinal.entity.Bootcamp
;
import
com.roshka.proyectofinal.entity.Bootcamp
;
import
com.roshka.proyectofinal.entity.PostulanteLenguaje
;
import
com.roshka.proyectofinal.entity.PostulanteLenguaje
;
import
jakarta.servlet.RequestDispatcher
;
import
jakarta.servlet.ServletException
;
import
jakarta.servlet.ServletException
;
import
jakarta.servlet.annotation.WebServlet
;
import
jakarta.servlet.annotation.WebServlet
;
import
jakarta.servlet.http.HttpServlet
;
import
jakarta.servlet.http.HttpServlet
;
...
@@ -18,13 +19,13 @@ import java.sql.Statement;
...
@@ -18,13 +19,13 @@ import java.sql.Statement;
@WebServlet
(
"/SaveServlet"
)
@WebServlet
(
"/SaveServlet"
)
public
class
SaveServlet
extends
HttpServlet
{
public
class
SaveServlet
extends
HttpServlet
{
protected
void
do
Pos
t
(
HttpServletRequest
request
,
HttpServletResponse
response
)
protected
void
do
Ge
t
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
throws
ServletException
,
IOException
{
response
.
setContentType
(
"text/html"
);
response
.
setContentType
(
"text/html"
);
PrintWriter
out
=
response
.
getWriter
();
PrintWriter
out
=
response
.
getWriter
();
boolean
rechazarDatos
=
false
;
boolean
rechazarDatos
=
false
;
int
bootcampActual
=
Integer
.
parseInt
(
request
.
getParameter
(
"bootcamp
_id
"
));
int
bootcampActual
=
Integer
.
parseInt
(
request
.
getParameter
(
"bootcamp"
));
try
{
try
{
Connection
con
=
DataBase
.
getConnection
();
Connection
con
=
DataBase
.
getConnection
();
...
@@ -107,25 +108,38 @@ public class SaveServlet extends HttpServlet {
...
@@ -107,25 +108,38 @@ public class SaveServlet extends HttpServlet {
}
}
if
(
status
>
0
){
if
(
status
>
0
){
//out.print("<p>Record saved successfully!</p>");
//out.print("<p>Record saved successfully!</p>");
out
.
print
(
" <div class=\"alert\">\n"
+
out
.
print
(
" <div class=\"alert\">\n"
+
" <span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">×</span> \n"
+
" <span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">×</span> \n"
+
" <strong>Formulario Cargado!</strong> EXITOSAMENTE CARGADO\n"
+
" <strong>Formulario Cargado!</strong> EXITOSAMENTE CARGADO\n"
+
"</div>"
);
"</div>"
);
request
.
getRequestDispatcher
(
"formulario.jsp"
).
include
(
request
,
response
);
request
.
setAttribute
(
"bootcamp"
,
bootcampActual
);
RequestDispatcher
rd
=
request
.
getRequestDispatcher
(
"formulario.jsp"
);
rd
.
include
(
request
,
response
);
//RequestDispatcher rd = request.getRequestDispatcher("formulario.jsp");
//rd.include(request, response);
}
else
{
}
else
{
if
(
rechazarDatos
){
if
(
rechazarDatos
){
out
.
print
(
" <div class=\"alert info\">\n"
+
" <span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">×</span> \n"
+
out
.
print
(
"<div class='alert info''>"
);
" <strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO\n"
+
out
.
print
(
"<span class='closebtn'' onclick='this.parentElement.style.display='none';'>×</span>"
);
"</div>"
);
out
.
print
(
"<strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO"
);
request
.
getRequestDispatcher
(
"formulario.jsp"
).
include
(
request
,
response
);
out
.
print
(
"</div>"
);
//request.getRequestDispatcher("formulario.jsp").include(request, response);
request
.
setAttribute
(
"bootcamp"
,
bootcampActual
);
RequestDispatcher
rd
=
request
.
getRequestDispatcher
(
"formulario.jsp"
);
rd
.
include
(
request
,
response
);
}
else
{
}
else
{
out
.
println
(
"Error al cargar datos"
);
out
.
println
(
"Error al cargar datos"
);
out
.
print
(
"
<div class=\"alert info error\">\n
"
+
out
.
print
(
"
<div class='alert info error'>
"
+
"
<span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">×</span> \n"
+
"<span class=\"closebtn\" onclick=\"this.parentElement.style.display='none';\">×</span> \n"
+
"
<strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO\n"
+
"<strong>Formulario ya Cargado!</strong> YA EXISTE EL FORMULARIO\n"
+
"</div>"
);
"</div>"
);
request
.
getRequestDispatcher
(
"formulario.jsp"
).
include
(
request
,
response
);
request
.
setAttribute
(
"bootcamp"
,
bootcampActual
);
RequestDispatcher
rd
=
request
.
getRequestDispatcher
(
"formulario.jsp"
);
rd
.
include
(
request
,
response
);
//request.getRequestDispatcher("formulario.jsp").include(request, response);
}
}
}
}
}
catch
(
Exception
ex
){
}
catch
(
Exception
ex
){
...
...
src/main/webapp/formulario.jsp
View file @
a48a7f23
...
@@ -42,10 +42,10 @@ pageEncoding="UTF-8"%>
...
@@ -42,10 +42,10 @@ pageEncoding="UTF-8"%>
</p>
</p>
<p
class=
"enter"
>
Si sigues interesado y cumples con los requisitos, completa el siguiente formulario:
</p>
<p
class=
"enter"
>
Si sigues interesado y cumples con los requisitos, completa el siguiente formulario:
</p>
<form
method=
"
pos
t"
action=
"SaveServlet"
class=
"form"
>
<form
method=
"
ge
t"
action=
"SaveServlet"
class=
"form"
>
<input
type=
"hidden"
name=
"bootcamp
_id
"
value=
"<%= request.getParameter("
bootcamp
")
%
>
">
<input
type=
"hidden"
name=
"bootcamp"
value=
"<%= request.getParameter("
bootcamp
")
%
>
">
<label
for=
"nombre"
>
Ingrese su Nombre:
</label>
<label
for=
"nombre"
>
Ingrese su Nombre:
</label>
<input
required
id=
"nombre"
name=
"nombre"
type=
"text"
><br>
<input
required
id=
"nombre"
name=
"nombre"
type=
"text"
><br>
...
...
src/main/webapp/index.html
View file @
a48a7f23
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
<p
data-block-key=
"cwggy"
>
Es un campo de entrenamiento intensivo y gratuito para principiantes que ya programan y quieren ser parte de la empresa
</p>
<p
data-block-key=
"cwggy"
>
Es un campo de entrenamiento intensivo y gratuito para principiantes que ya programan y quieren ser parte de la empresa
</p>
</div>
</div>
<div
class=
"postulacion"
>
<div
class=
"postulacion"
>
<a
href=
"
formulario
.jsp"
><button
type=
"submit"
class=
"cta-main"
>
POSTULACION
</button></a>
<a
href=
"
bootcamp
.jsp"
><button
type=
"submit"
class=
"cta-main"
>
POSTULACION
</button></a>
<!-- <a href="/postulacion" class="cta-main">POSTULACION</a> -->
<!-- <a href="/postulacion" class="cta-main">POSTULACION</a> -->
</div>
</div>
</div>
</div>
...
...
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