Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
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
1
Merge Requests
1
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
Oscar Enrique Gonzalez Escurra
th-app-java
Commits
b18ad9e9
Commit
b18ad9e9
authored
Nov 15, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
home controller
parent
fd8a70fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
43 deletions
+50
-43
curriculumsearch/src/main/java/com/roshka/controller/HomeController.java
+13
-0
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+32
-38
curriculumsearch/src/main/webapp/jsp/cargo-form.jsp
+5
-5
No files found.
curriculumsearch/src/main/java/com/roshka/controller/HomeController.java
0 → 100644
View file @
b18ad9e9
package
com
.
roshka
.
controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@Controller
@RequestMapping
(
"/home"
)
public
class
HomeController
{
@RequestMapping
()
public
String
home
(
Model
model
)
{
return
"index"
;
}
}
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
b18ad9e9
...
@@ -81,13 +81,6 @@ public class PostulanteController {
...
@@ -81,13 +81,6 @@ public class PostulanteController {
this
.
carRepo
=
carRepo
;
this
.
carRepo
=
carRepo
;
}
}
@RequestMapping
(
"home"
)
public
String
index
()
{
return
"index"
;
}
@RequestMapping
(
"/postulantes"
)
@RequestMapping
(
"/postulantes"
)
public
String
postulantes
(
Model
model
,
public
String
postulantes
(
Model
model
,
@RequestParam
(
required
=
false
)
Long
tecId
,
@RequestParam
(
required
=
false
)
Long
tecId
,
...
@@ -182,8 +175,8 @@ public class PostulanteController {
...
@@ -182,8 +175,8 @@ public class PostulanteController {
return
"redirect:/postulacion-correcta"
;
return
"redirect:/postulacion-correcta"
;
}
}
@GetMapping
(
"/postulacion-correcta"
)
@GetMapping
(
"/postulacion-correcta"
)
public
String
successPostulation
(
Model
model
){
public
String
successPostulation
(
Model
model
){
model
.
addAttribute
(
"mensaje1"
,
"Tu informacion se ha recibido correctamente!"
);
model
.
addAttribute
(
"mensaje1"
,
"Tu informacion se ha recibido correctamente!"
);
model
.
addAttribute
(
"mensaje2"
,
" espera por que nos pongamos en contacto!"
);
model
.
addAttribute
(
"mensaje2"
,
" espera por que nos pongamos en contacto!"
);
return
"exitoRegistro"
;
return
"exitoRegistro"
;
...
@@ -197,33 +190,33 @@ public class PostulanteController {
...
@@ -197,33 +190,33 @@ public class PostulanteController {
.
body
(
ex
.
getMessage
());
.
body
(
ex
.
getMessage
());
}
}
@ResponseStatus
(
HttpStatus
.
BAD_REQUEST
)
@ResponseStatus
(
HttpStatus
.
BAD_REQUEST
)
@ExceptionHandler
({
ConstraintViolationException
.
class
})
@ExceptionHandler
({
ConstraintViolationException
.
class
})
public
ResponseEntity
<
String
>
handleValidationExceptions2
(
public
ResponseEntity
<
String
>
handleValidationExceptions2
(
ConstraintViolationException
ex
)
{
ConstraintViolationException
ex
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
)
return
ResponseEntity
.
status
(
HttpStatus
.
BAD_REQUEST
)
.
body
(
ex
.
getMessage
());
.
body
(
ex
.
getMessage
());
}
}
@GetMapping
({
"/postulante/{postulanteId}"
})
@GetMapping
({
"/postulante/{postulanteId}"
})
public
String
getPostulanteDetalle
(
Model
model
,
@PathVariable
(
"postulanteId"
)
Long
postulanteId
)
{
public
String
getPostulanteDetalle
(
Model
model
,
@PathVariable
(
"postulanteId"
)
Long
postulanteId
)
{
Postulante
p
=
post
.
findById
(
postulanteId
).
orElse
(
null
);
Postulante
p
=
post
.
findById
(
postulanteId
).
orElse
(
null
);
model
.
addAttribute
(
"postulante"
,
p
);
model
.
addAttribute
(
"postulante"
,
p
);
model
.
addAttribute
(
"estadoP"
,
EstadoPostulante
.
values
());
model
.
addAttribute
(
"estadoP"
,
EstadoPostulante
.
values
());
return
"detallepostulante"
;
return
"detallepostulante"
;
}
}
@PostMapping
({
"/postulante/{postulanteId}"
})
@PostMapping
({
"/postulante/{postulanteId}"
})
public
String
setPostulanteEstado
(
@ModelAttribute
Postulante
postulante
,
BindingResult
result
,
@PathVariable
(
"postulanteId"
)
Long
postulanteId
)
{
public
String
setPostulanteEstado
(
@ModelAttribute
Postulante
postulante
,
BindingResult
result
,
@PathVariable
(
"postulanteId"
)
Long
postulanteId
)
{
//post.setPostulanteEstadoAndComentario(postulante.getEstadoPostulante(),postulante.getComentarioRRHH(), postulante.getId());
//post.setPostulanteEstadoAndComentario(postulante.getEstadoPostulante(),postulante.getComentarioRRHH(), postulante.getId());
Postulante
postulanteVd
=
post
.
getById
(
postulanteId
);
Postulante
postulanteVd
=
post
.
getById
(
postulanteId
);
postulanteVd
.
setEstadoPostulante
(
postulante
.
getEstadoPostulante
());
postulanteVd
.
setEstadoPostulante
(
postulante
.
getEstadoPostulante
());
postulanteVd
.
setComentarioRRHH
(
postulante
.
getComentarioRRHH
());
postulanteVd
.
setComentarioRRHH
(
postulante
.
getComentarioRRHH
());
post
.
setPostulanteEstadoAndComentario
(
postulante
.
getEstadoPostulante
(),
postulante
.
getComentarioRRHH
(),
postulanteId
);
post
.
setPostulanteEstadoAndComentario
(
postulante
.
getEstadoPostulante
(),
postulante
.
getComentarioRRHH
(),
postulanteId
);
//post.save(postulanteVd);
//post.save(postulanteVd);
return
"redirect:/postulante/"
+
postulanteId
;
return
"redirect:/postulante/"
+
postulanteId
;
}
}
}
}
\ No newline at end of file
curriculumsearch/src/main/webapp/jsp/cargo-form.jsp
View file @
b18ad9e9
...
@@ -24,15 +24,15 @@ contentType="text/html;charset=UTF-8" language="java" %>
...
@@ -24,15 +24,15 @@ contentType="text/html;charset=UTF-8" language="java" %>
<jsp:include
page=
"header.jsp"
/>
<jsp:include
page=
"header.jsp"
/>
<jsp:include
page=
"alerts.jsp"
/>
<jsp:include
page=
"alerts.jsp"
/>
<div
class=
"container-xxl my-md-4 bd-layout"
>
<div
class=
"container-xxl my-md-4 bd-layout"
>
<h2>
Agregar Cargo
</h2
>
<div
class=
"card d-flex flex-column justify-content-center align-items-center mx-auto mt-2 p-3"
style=
"width: 20rem;"
>
<div
class=
"p-3 mb-2 bg-light text-dark border border-light"
>
<h5
class=
"card-title"
>
${cargo.id == null ? "Agregar" : "Modificar"} Cargo
</h5
>
<form:form
<form:form
action=
"/cargo/${cargo.id == null ? '' : cargo.id}"
action=
"/cargo/${cargo.id == null ? '' : cargo.id}"
method=
"post"
method=
"post"
modelAttribute=
"cargo"
modelAttribute=
"cargo"
class=
"
row row-cols-lg-auto g-3 align-items-center
"
class=
"
card-body d-flex flex-column
"
>
>
<div
class=
"
col-12
"
>
<div
class=
""
>
<form:label
class=
"form-label visually-hidden"
path=
"nombre"
<form:label
class=
"form-label visually-hidden"
path=
"nombre"
>
Nombre del cargo
>
Nombre del cargo
</form:label>
</form:label>
...
@@ -44,7 +44,7 @@ contentType="text/html;charset=UTF-8" language="java" %>
...
@@ -44,7 +44,7 @@ contentType="text/html;charset=UTF-8" language="java" %>
/>
/>
</div>
</div>
<div
class=
"
col-12
"
>
<div
class=
"
mt-2 align-self-end
"
>
<input
type=
"submit"
value=
"Guardar"
class=
"btn btn-primary"
/>
<input
type=
"submit"
value=
"Guardar"
class=
"btn btn-primary"
/>
</div>
</div>
</form:form>
</form: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