GWT object parameter from javascript to java (JavaScriptObject to JSONObject)

I have an Object that I want to pass from JavaScript to Java in a GWT application.

This object may have binary fields. So this is different from a very similar question, only a number was transmitted. Passing javascript from external javascript to java

I define a callback like

public static void cbSysInfoSucces(JavaScriptObject o1) { } 

But I do not know how to convert JavaScriptObject to JSONObject

Could you also consult in the format of the $entry() function if I want to pass Object in java

+6
source share
2 answers

Use the JSONObject constructor (JavaScriptObject jsValue) to create a new JSONObject from the provided JavaScript value.

+7
source

I had the same problem a week ago and did not find the answer to this question. I just encoded the object as a string and passed it to Java

+1
source

All Articles