i have a spring method in my controller that has a String type return result when i consume The Web Service by Angular ($http) i get
SyntaxError: Unexpected token a at Object.parse (native)
this is my controller
@RequestMapping(value = "/api/loggeduser",method=RequestMethod.GET, produces =MediaType.APPLICATION_JSON_VALUE )
public ResponseEntity<String> findMessagesForUser(Principal principal) {
System.out.println("looged user login="+principal.getName());
return new ResponseEntity<String>(principal.getName(), HttpStatus.OK);
}
and this my Angular Function :
$http.get("http://localhost:8080/projet/rest/users/api/loggeduser").success(function(data) {
console.log(data);
})