Thierry Boileau wrote:
>
> Hello Sebastian,
>
> you can also simplify your code as follow:
>
> import org.json.JSONException;
> import org.json.JSONObject;
> import org.restlet.resource.Get;
> import org.restlet.resource.ServerResource;
>
> public class TestJsonServerResource extends ServerResource {
> @Get
> public JSONObject doGet() throws JSONException {
> JSONObject json = new JSONObject();
> json.put("test", "Test");
> json.put("test2", "Test2");
> return json;
> }
> }
>
> (please note that this simplification is not part of the zip file I've
> just sent to you.)
>
> Best regards,
> Thierry Boileau
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2763663
>
Hi Thierry,
unfortunately i din't get any zip file.
Yes i know i can write it like that, and it would work too.
But this way the headers are not set to application/json but to text/plain.
http://restlet-discuss.1400322.n2.nabble.com/IncompatibleClassChangeError-with-ConcurrentMap-tp6393712p6453417.html
See here.
When you run my code, is the field JsonValue in the JsonRepresentation set?
Best Regards,
Sebastian
--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/IncompatibleClassChangeError-with-ConcurrentMap-tp6393712p6469478.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2764227