API method fetches information but does not appear on the front end

2

I have a method of my API that searches the database

@RequestMapping(method = RequestMethod.GET, value = "/entidadesUsuarioPermissao/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
    public ResponseEntity<Collection<PermissoesPaginas>> buscarEntidadesUsuarioP(@PathVariable Long id) {

        Collection<PermissoesPaginas> entidadesBuscados = ppService.buscarTodas(id);
        return new ResponseEntity<>(entidadesBuscados, HttpStatus.OK);

    } 

and comes all the information I need:

However,whenIdebugthefrontendtheentityobjectdoesnotappear

Thisismyanswerthatarrivesatthefrontend

Notethattheentityobjectdoesnotappear.

Thefront-endmethodisthis:

$http({method:'GET',url:'/entidadesUsuarioPermissao/'+id}).then(function(response){$scope.usuarios=response.data;},function(response){console.log(response.data);console.log(response.status);});

consoleexitonscreen

    
asked by anonymous 24.10.2017 / 13:29

2 answers

0

Add "@ResponseBody" in your annotation and use this jackjson

@RequestMapping (value="/services/SayHello2Me" , method=RequestMethod.GET, produces="application/json")
    
25.10.2017 / 16:35
0

As noted, the problem was in the get method inside the PermissionsPages class, where the entity name was not mapped to display.

    
25.10.2017 / 12:07