How can I make Apache Wink to return something like
{ Message: "Hello World!" }
I have the following code:
@Asset
public class Hello {
protected String message;
public Hello() {
}
@Produces(MediaType.APPLICATION_JSON)
public String getMessage() {
return message;
}
@Consumes(MediaType.APPLICATION_JSON)
public void setMessage(String message) {
this.message = message;
}
}
@Path("/helloworld")
public class HelloWorldResource {
@GET
@Produces(MediaType.APPLICATION_JSON)
public Hello getMessage() {
Hello hello = new Hello();
hello.setMessage("Hello World!");
return hello;
}
}
and the server returns only "Hello World!". How can I make it return JSON that have a structure similar with the java class?