Hi,
imho he's just missing @Produces({MediaType.APPLICATION_JSON }).
On 28 February 2012 19:33, Gonfi den Tschal <gonfidentschal_at_gmail.com> wrote:
> a string is a string, also in json. it makes no sense to wrap that in
> another object or formatting. it's not xml ;-)
>
>
>
>
> On Tue, Feb 28, 2012 at 8:16 PM, Martin Ždila <m.zdila_at_gmail.com> wrote:
>> Hello
>>
>> I have method like this
>>
>> @GET
>> public String getMessage() {
>> return "Hello";
>> }
>>
>>
>> If I call it with Accept: application/json, I get a plain string
>> without quotes. How to get properly encoded JSON string? With complex
>> objects it works. I am using Jersey with Jackson.
>>
>> Thanks in advance.
>>
>> --
>> Ing. Martin Ždila
>> tel:+421-908-363-848
>> mailto:martin_at_zdila.sk
>> http://www.zdila.sk/