1

How to create json object and put my values in it in GWT?

import com.google.gwt.json.client.JSONObject;
...
JSONObject myJson = new JSONObject();
myJson.put("hello", "world");

Because at put method I've receive that error: The method put(String, JSONValue) in the type JSONObject is not applicable for the arguments (String, String)

1 Answer 1

1
myJson.put("hello", new JSONString("world"));
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.