Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <dependency>
  2. <groupId>org.codehaus.jackson</groupId>
  3. <artifactId>jackson-mapper-asl</artifactId>
  4. <version>1.9.13</version>
  5. </dependency>
  6.  
  7. @RestController
  8. public class CandidatosWS {
  9.  
  10. @Autowired
  11. CandidatoService candidatoService;
  12.  
  13. @RequestMapping(value = "/candidatos/", method = RequestMethod.GET)
  14. public ResponseEntity<List<Candidato>> allCandidatos() {
  15.  
  16. List<Candidato> listCandidatos = null;
  17.  
  18. try {
  19.  
  20. listCandidatos = candidatoService.listarCandidatos();
  21.  
  22. } catch (Exception e) {
  23. e.printStackTrace();
  24. }
  25.  
  26. return new ResponseEntity<List<Candidato>>(listCandidatos, HttpStatus.OK);
  27. }
  28. }
  29.  
  30. <html>
  31. <head>
  32. <title>Error</title>
  33. </head>
  34. <body>Not Acceptable</body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement