From 87be5ebbf8985db96607fc50444605b37e609465 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 25 Nov 2021 11:54:55 -0300 Subject: [PATCH] Llamadas a archivos estaticos por ruta absoluta. Se cambiaron las rutas de los archivos estaticos(css, js, img) de relativo a absoluto. Tambien el controller de RRHHPostulantes y tecnologia se unifico. --- curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java | 3 +-- curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java | 8 ++++---- curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java | 13 +++++++------ curriculumsearch/src/main/java/com/roshka/controller/TecnologiaController.java | 7 ++++--- curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp | 86 +++++++++++++++++++++++++++++++++++++++++++------------------------------------------- curriculumsearch/src/main/webapp/jsp/exitoRegistro.jsp | 2 +- curriculumsearch/src/main/webapp/jsp/forgot_password_form.jsp | 2 +- curriculumsearch/src/main/webapp/jsp/index.jsp | 4 ++-- curriculumsearch/src/main/webapp/jsp/layouts/base.jsp | 6 +++--- curriculumsearch/src/main/webapp/jsp/login.jsp | 8 ++++---- curriculumsearch/src/main/webapp/jsp/postulante-form.jsp | 6 +++--- curriculumsearch/src/main/webapp/jsp/postulantes.jsp | 6 +++--- curriculumsearch/src/main/webapp/jsp/tecnologia-form.jsp | 2 +- curriculumsearch/src/main/webapp/jsp/tecnologias.jsp | 2 +- 14 files changed, 78 insertions(+), 77 deletions(-) diff --git a/curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java b/curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java index 4cd6033..163a8ea 100644 --- a/curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java +++ b/curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java @@ -51,10 +51,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .mvcMatchers("/cargo*").authenticated() .mvcMatchers("/convocatoria*").authenticated() .mvcMatchers("/convocatoria/crear/*").authenticated() - .mvcMatchers("/tecnologia*").authenticated() + .mvcMatchers("/tecnologias","/tecnologias/**").authenticated() .mvcMatchers("/postulantes","/postulantes/**").authenticated() .mvcMatchers("/edit-user-data").authenticated() - .mvcMatchers("/postulantesExcel*").authenticated() .anyRequest().permitAll() .and() .formLogin() diff --git a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java index 6e200e7..4dda523 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java @@ -21,8 +21,8 @@ import org.springframework.web.servlet.view.RedirectView; import javax.validation.ConstraintViolationException; - @Controller +@RequestMapping("/work-with-us") public class PostulanteController { PostulanteRepository post; TecnologiaRepository tecRepo; @@ -55,7 +55,7 @@ public class PostulanteController { } - @RequestMapping(value = "/work-with-us",method = RequestMethod.GET) + @RequestMapping(method = RequestMethod.GET) public String getFormPostulante(Model model){ model.addAttribute("tecnologias", tecRepo.findAll()); model.addAttribute("tiposDeEstudio", TipoDeEstudio.values()); @@ -77,7 +77,7 @@ public class PostulanteController { } - @PostMapping(value = "/work-with-us",consumes = "multipart/form-data") + @PostMapping(consumes = "multipart/form-data") public RedirectView guardarPostulante(@RequestPart(name = "file",required = false) MultipartFile file,@RequestPart("postulante") Postulante postulante, RedirectAttributes redirectAttributes){ //Codigo encargado de modificar postulacion si se envia mismo CI //Codigo encargado de modificar postulacion si se envia mismo CI @@ -117,7 +117,7 @@ public class PostulanteController { - @GetMapping("/work-with-us/postulacion-correcta") + @GetMapping("/postulacion-correcta") public String successPostulation(Model model){ model.addAttribute("mensaje1", "Tu informacion se ha recibido correctamente!"); model.addAttribute("mensaje2", " espera por que nos pongamos en contacto!"); diff --git a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java index b199576..8e53ac6 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java @@ -39,6 +39,7 @@ import java.util.List; @Controller +@RequestMapping("/postulantes") public class PostulanteRRHHController { PostulanteRepository post; TecnologiaRepository tecRepo; @@ -72,7 +73,7 @@ public class PostulanteRRHHController { this.fileRepo = fileRepo; } - @RequestMapping("/postulantes") + @RequestMapping() public String postulantes(HttpServletRequest request, Model model, @RequestParam(required = false)Long tecId, @RequestParam(required = false)String nombre, @@ -134,7 +135,7 @@ public class PostulanteRRHHController { } - @RequestMapping("/postulantesExcel") + @RequestMapping("/excel") public void exportPostulantesExcel(HttpServletResponse response, Model model, @RequestParam(required = false)Long tecId, @RequestParam(required = false)String nombre, @@ -195,7 +196,7 @@ public class PostulanteRRHHController { } - @GetMapping({"/postulantes/{postulanteId}"}) + @GetMapping({"/{postulanteId}"}) public String getPostulanteDetalle(Model model, @PathVariable("postulanteId") Long postulanteId) { Postulante p = post.findById(postulanteId).orElse(null); model.addAttribute("postulante",p); @@ -206,7 +207,7 @@ public class PostulanteRRHHController { } - @PostMapping({"/postulantes/{postulanteId}"}) + @PostMapping({"/{postulanteId}"}) public String setPostulanteEstado(@ModelAttribute Postulante postulante, BindingResult result, @PathVariable("postulanteId") Long postulanteId) { //post.setPostulanteEstadoAndComentario(postulante.getEstadoPostulante(),postulante.getComentarioRRHH(), postulante.getId()); Postulante postulanteVd = post.getById(postulanteId); @@ -221,7 +222,7 @@ public class PostulanteRRHHController { return "redirect:/postulantes/"+postulanteId; } - @GetMapping("/postulantes/cvFile/{fileId}") + @GetMapping("/cvFile/{fileId}") public ResponseEntity downloadFile(@PathVariable String fileId) { // Load file from database DBFile dbFile; @@ -240,7 +241,7 @@ public class PostulanteRRHHController { } - @GetMapping("/postulantes/{id}/pdf") + @GetMapping("/{id}/pdf") public ResponseEntity downloadPDF(@PathVariable Long id) { // Load file from database PdfGenerator pdf = new PdfGenerator(); diff --git a/curriculumsearch/src/main/java/com/roshka/controller/TecnologiaController.java b/curriculumsearch/src/main/java/com/roshka/controller/TecnologiaController.java index 2080745..d3ae38e 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/TecnologiaController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/TecnologiaController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @Controller +@RequestMapping("/tecnologias") public class TecnologiaController { TecnologiaRepository tecRepo; @@ -26,7 +27,7 @@ public TecnologiaController(TecnologiaRepository tecRepo){ } -@GetMapping(path = {"/tecnologia","/tecnologia/{id}"}) +@GetMapping(path = {"/agregar","/modificar/{id}"}) public String addtecnologiaView(Model model,@PathVariable(required = false) Long id) { @@ -35,7 +36,7 @@ public String addtecnologiaView(Model model,@PathVariable(required = false) Long return "tecnologia-form"; } -@RequestMapping("/tecnologias") +@RequestMapping() public String menuTecnologias(Model model,@RequestParam(required = false) String nombre,@RequestParam(defaultValue = "0")Integer nroPagina) { final Integer CANTIDAD_POR_PAGINA = 10; Pageable page = PageRequest.of(nroPagina,CANTIDAD_POR_PAGINA,Sort.by("id")); @@ -53,7 +54,7 @@ public String addtecnologiaView(Model model,@PathVariable(required = false) Long return "tecnologias"; } -@PostMapping(path = {"/tecnologia","/tecnologia/{id}"}) +@PostMapping(path = {"/agregar","/modificar/{id}"}) public String addtecnologia(@Valid @ModelAttribute Tecnologia tecnologia, BindingResult result, @PathVariable(required = false) Long id, Model model) { if(result.hasErrors() || (id==null && tecRepo.existsByNombreIgnoreCase(tecnologia.getNombre()))){ model.addAttribute("mismoNombre", true); diff --git a/curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp b/curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp index b8c78fc..49cdf9f 100644 --- a/curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp +++ b/curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp @@ -390,49 +390,49 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/curriculumsearch/src/main/webapp/jsp/exitoRegistro.jsp b/curriculumsearch/src/main/webapp/jsp/exitoRegistro.jsp index 22d442c..c68cc89 100644 --- a/curriculumsearch/src/main/webapp/jsp/exitoRegistro.jsp +++ b/curriculumsearch/src/main/webapp/jsp/exitoRegistro.jsp @@ -4,7 +4,7 @@ - +