Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- <version>1.9.13</version>
- </dependency>
- @RestController
- public class CandidatosWS {
- @Autowired
- CandidatoService candidatoService;
- @RequestMapping(value = "/candidatos/", method = RequestMethod.GET)
- public ResponseEntity<List<Candidato>> allCandidatos() {
- List<Candidato> listCandidatos = null;
- try {
- listCandidatos = candidatoService.listarCandidatos();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return new ResponseEntity<List<Candidato>>(listCandidatos, HttpStatus.OK);
- }
- }
- <html>
- <head>
- <title>Error</title>
- </head>
- <body>Not Acceptable</body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement