我们试图通过primefaces-extensions remoteCommand传递一个对象,如下所示:
function dispatchOurObject(ourObject) {
sendMessageToServer(ourObject);
}
这是我们的remoteCommand标签:
<pe:remoteCommand name="sendMessageToServer" process="@this"
actionListener="#{ourController.dispatchOurObject}">
<pe:methodSignature
parameters="com.package.OurObject" />
<pe:methodParam name="ourObject">
<pe:convertJson />
</pe:methodParam>
</pe:remoteCommand>
最后但并非最不重要的是,这是我们在支持bean中的方法:
public void dispatchOurObject(OurObject ourObject) {
//Do some stuff.
}
这是我们得到的错误:
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2
编辑:at com.google.gson.Gson.fromJson(Gson.java:803)