I'm new to JAX-RS + RESTEasy
What is impeding me is that the service return the JSON String without double quotes.
@Path("/hello")
public class HelloService {
@GET
@Path("say")
@Produces(MediaType.APPLICATION_JSON)
public String say() {
return "Hello";
}
}
When I call "/hello/say" it just returns Hello but what I'm expecting is "Hello"
Googled for several days. I have a piece of Javascript using JQuery which calls the service like this:
$(function(){
$.ajax({
url : "services/hello/say",
context : $('#message'),
success : function(data){
$(this).html(data);
},
error : function(xhr, ajaxOptions, thrownError){
$(this).html(xhr.status + "<br>" + thrownError);
}
});
});
And this is the result
SyntaxError: Unable to parse JSON string
Although the status is 200. Is there a way to solve this rather than manually adding the double quotes to the string ?