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
4b3ad9a6
Commit
4b3ad9a6
authored
May 17, 2022
by
Jose Baez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sendemail3' into 'develop'
Sendemail3 See merge request
!38
parents
7f75482d
eb7dcb21
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
5 deletions
+70
-5
pom.xml
+6
-0
src/main/java/com/roshka/proyectofinal/SendMail.java
+50
-0
src/main/java/com/roshka/proyectofinal/bootcamp/BootcampDao.java
+1
-0
src/main/java/com/roshka/proyectofinal/bootcamp/SaveServlet.java
+5
-3
src/main/java/com/roshka/proyectofinal/profesor/ProfesorDao.java
+2
-0
src/main/webapp/formulario_bootcamp.jsp
+2
-2
src/main/webapp/postulante-consulta.jsp
+4
-0
No files found.
pom.xml
View file @
4b3ad9a6
...
@@ -47,6 +47,12 @@
...
@@ -47,6 +47,12 @@
<version>
42.3.5
</version>
<version>
42.3.5
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.sun.mail
</groupId>
<artifactId>
javax.mail
</artifactId>
<version>
1.6.2
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
src/main/java/com/roshka/proyectofinal/SendMail.java
0 → 100644
View file @
4b3ad9a6
package
com
.
roshka
.
proyectofinal
;
import
java.util.Properties
;
import
javax.activation.DataHandler
;
import
javax.activation.FileDataSource
;
import
javax.mail.BodyPart
;
import
javax.mail.Message
;
import
javax.mail.MessagingException
;
import
javax.mail.Session
;
import
javax.mail.Transport
;
import
javax.mail.internet.AddressException
;
import
javax.mail.internet.InternetAddress
;
import
javax.mail.internet.MimeBodyPart
;
import
javax.mail.internet.MimeMessage
;
import
javax.mail.internet.MimeMultipart
;
import
javax.swing.*
;
public
class
SendMail
{
public
SendMail
()
{
}
public
void
meetingMail
(
String
postulanteCorreoDestino
)
throws
AddressException
,
MessagingException
{
// emanuel.lugo01@gmail.com
String
correo
=
"nahuelmereles1@gmail.com"
;
String
contra
=
"ozydnpynyoqsowjn"
;
String
correoDestino
=
postulanteCorreoDestino
;
Properties
properties
=
new
Properties
();
properties
.
put
(
"mail.smtp.host"
,
"smtp.gmail.com"
);
properties
.
setProperty
(
"mail.smtp.starttls.enable"
,
"true"
);
properties
.
put
(
"mail.smtp.ssl.trust"
,
"smtp.gmail.com"
);
properties
.
setProperty
(
"mail.smtp.port"
,
"587"
);
properties
.
setProperty
(
"mail.smtp,user"
,
correo
);
properties
.
setProperty
(
"mail.smtp.auth"
,
"true"
);
Session
s
=
Session
.
getDefaultInstance
(
properties
);
MimeMessage
mensaje
=
new
MimeMessage
(
s
);
mensaje
.
setFrom
(
new
InternetAddress
(
correo
));
mensaje
.
addRecipient
(
Message
.
RecipientType
.
TO
,
new
InternetAddress
(
correoDestino
));
mensaje
.
setSubject
(
"Hola que tal soy yo"
);
mensaje
.
setText
(
"Ya funciona?"
);
Transport
transport
=
s
.
getTransport
(
"smtp"
);
transport
.
connect
(
correo
,
contra
);
transport
.
sendMessage
(
mensaje
,
mensaje
.
getAllRecipients
());
transport
.
close
();
JOptionPane
.
showMessageDialog
(
null
,
"Mensaje enviado"
);
}
}
src/main/java/com/roshka/proyectofinal/bootcamp/BootcampDao.java
View file @
4b3ad9a6
...
@@ -13,6 +13,7 @@ public class BootcampDao {
...
@@ -13,6 +13,7 @@ public class BootcampDao {
int
status
=
0
;
int
status
=
0
;
try
{
try
{
System
.
out
.
println
(
b
.
getId_profesor
());
Connection
con
=
DataBase
.
getConnection
();
Connection
con
=
DataBase
.
getConnection
();
PreparedStatement
ps
=
con
.
prepareStatement
(
PreparedStatement
ps
=
con
.
prepareStatement
(
"insert into bootcamp (id_lenguaje,id_profesor,fecha_inicio,fecha_fin,descripcion,imagen,titulo,activo) values (?,?,?::date,?::date,?,?,?,?)"
);
"insert into bootcamp (id_lenguaje,id_profesor,fecha_inicio,fecha_fin,descripcion,imagen,titulo,activo) values (?,?,?::date,?::date,?,?,?,?)"
);
...
...
src/main/java/com/roshka/proyectofinal/bootcamp/SaveServlet.java
View file @
4b3ad9a6
...
@@ -19,6 +19,7 @@ public class SaveServlet extends HttpServlet {
...
@@ -19,6 +19,7 @@ public class SaveServlet extends HttpServlet {
int
id_lenguaje
=
Integer
.
parseInt
(
request
.
getParameter
(
"id_lenguaje"
));
int
id_lenguaje
=
Integer
.
parseInt
(
request
.
getParameter
(
"id_lenguaje"
));
int
id_profesor
=
Integer
.
parseInt
(
request
.
getParameter
(
"id_profesor"
));
int
id_profesor
=
Integer
.
parseInt
(
request
.
getParameter
(
"id_profesor"
));
System
.
out
.
println
(
id_profesor
);
String
fecha_inicio
=
request
.
getParameter
(
"fecha_inicio"
);
String
fecha_inicio
=
request
.
getParameter
(
"fecha_inicio"
);
String
fecha_fin
=
request
.
getParameter
(
"fecha_fin"
);
String
fecha_fin
=
request
.
getParameter
(
"fecha_fin"
);
String
descripcion
=
request
.
getParameter
(
"descripcion"
);
String
descripcion
=
request
.
getParameter
(
"descripcion"
);
...
@@ -26,11 +27,12 @@ public class SaveServlet extends HttpServlet {
...
@@ -26,11 +27,12 @@ public class SaveServlet extends HttpServlet {
String
titulo
=
request
.
getParameter
(
"titulo"
);
String
titulo
=
request
.
getParameter
(
"titulo"
);
String
activoStr
=
request
.
getParameter
(
"activo"
);
String
activoStr
=
request
.
getParameter
(
"activo"
);
System
.
out
.
println
(
activoStr
);
System
.
out
.
println
(
activoStr
);
Boolean
activo
=
fals
e
;
Boolean
activo
=
tru
e
;
if
(
activoStr
.
equals
(
"on"
)
)
{
if
(
activoStr
==
null
)
{
activo
=
tru
e
;
activo
=
fals
e
;
}
}
Bootcamp
b
=
new
Bootcamp
(
id_lenguaje
,
id_profesor
,
fecha_inicio
,
fecha_fin
,
descripcion
,
imagen
,
titulo
,
activo
);
Bootcamp
b
=
new
Bootcamp
(
id_lenguaje
,
id_profesor
,
fecha_inicio
,
fecha_fin
,
descripcion
,
imagen
,
titulo
,
activo
);
int
status
=
BootcampDao
.
save
(
b
);
int
status
=
BootcampDao
.
save
(
b
);
...
...
src/main/java/com/roshka/proyectofinal/profesor/ProfesorDao.java
View file @
4b3ad9a6
package
com
.
roshka
.
proyectofinal
.
profesor
;
package
com
.
roshka
.
proyectofinal
.
profesor
;
import
com.roshka.proyectofinal.DataBase
;
import
com.roshka.proyectofinal.DataBase
;
import
com.roshka.proyectofinal.entity.Bootcamp
;
import
com.roshka.proyectofinal.entity.Profesor
;
import
com.roshka.proyectofinal.entity.Profesor
;
import
java.sql.Connection
;
import
java.sql.Connection
;
...
@@ -39,6 +40,7 @@ public class ProfesorDao {
...
@@ -39,6 +40,7 @@ public class ProfesorDao {
ResultSet
rs
=
ps
.
executeQuery
();
ResultSet
rs
=
ps
.
executeQuery
();
while
(
rs
.
next
()){
while
(
rs
.
next
()){
Profesor
profesorObject
=
new
Profesor
();
Profesor
profesorObject
=
new
Profesor
();
profesorObject
.
setId
(
rs
.
getInt
(
"id"
));
profesorObject
.
setNombre
(
rs
.
getString
(
"nombre"
));
profesorObject
.
setNombre
(
rs
.
getString
(
"nombre"
));
profesorObject
.
setApellido
(
rs
.
getString
(
"apellido"
));
profesorObject
.
setApellido
(
rs
.
getString
(
"apellido"
));
profesorObject
.
setNro_cedula
(
rs
.
getInt
(
"nro_cedula"
));
profesorObject
.
setNro_cedula
(
rs
.
getInt
(
"nro_cedula"
));
...
...
src/main/webapp/formulario_bootcamp.jsp
View file @
4b3ad9a6
...
@@ -104,13 +104,13 @@
...
@@ -104,13 +104,13 @@
<th>
<
%=
boot
.
getNombre_profesor
()
+
"
"
+
boot
.
getApellido_profesor
()
%
>
</th>
<th>
<
%=
boot
.
getNombre_profesor
()
+
"
"
+
boot
.
getApellido_profesor
()
%
>
</th>
<th>
<
%=
boot
.
getActivo
()
%
>
</th>
<th>
<
%=
boot
.
getActivo
()
%
>
</th>
<th>
<form
action=
"EditServletBootcamp"
method=
"get"
>
<th>
<form
action=
"EditServletBootcamp"
method=
"get"
>
<input
type=
"hidden"
name=
"id"
value=
<%=
boot
.
getId
()
%
>
>
<input
type=
"hidden"
name=
"id"
id=
"id"
value=
<%=
boot
.
getId
()
%
>
>
<input
type=
"submit"
value=
"Editar"
></input>
<input
type=
"submit"
value=
"Editar"
></input>
</form>
</form>
</th>
</th>
<th>
<th>
<form
action=
"DeleteServletBootcamp"
method=
"get"
>
<form
action=
"DeleteServletBootcamp"
method=
"get"
>
<input
type=
"hidden"
name=
"id"
value=
<%=
boot
.
getId
()
%
>
>
<input
type=
"hidden"
name=
"id"
id=
"id"
value=
<%=
boot
.
getId
()
%
>
>
<input
type=
"submit"
value=
"Borrar"
>
</input>
<input
type=
"submit"
value=
"Borrar"
>
</input>
</form>
</form>
</th>
</th>
...
...
src/main/webapp/postulante-consulta.jsp
View file @
4b3ad9a6
...
@@ -119,6 +119,10 @@
...
@@ -119,6 +119,10 @@
<form
action=
"filtros-postulante"
method=
"get"
>
<form
action=
"filtros-postulante"
method=
"get"
>
<input
type=
"hidden"
name=
"valor"
value=
"0"
>
<input
type=
"hidden"
name=
"valor"
value=
"0"
>
<input
type=
"hidden"
name=
"id"
value=
"${postulante.id}"
>
<input
type=
"hidden"
name=
"id"
value=
"${postulante.id}"
>
<input
type=
"hidden"
name=
"nombre"
value=
"${postulante.nombre}"
>
<input
type=
"hidden"
name=
"apellido"
value=
"${postulante.apellido}"
>
<input
type=
"hidden"
name=
"correo"
value=
"${postulante.correo}"
>
<button
type=
"submit"
>
Rechazar
</button>
<button
type=
"submit"
>
Rechazar
</button>
</form>
</form>
</c:when>
</c:when>
...
...
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