简体   繁体   English

如何使用DWR将对象从JavaScript传递到Java?

[英]How can I pass an Object from javascript to java with DWR?

I am able to pass String and int but not Object. 我可以传递字符串和整数,但不能传递对象。 Is it possible? 可能吗?

 var map = new Object();
    .. Add to object....

         MyManager.setValues(map, {
             callback:function(message){
                 alert(message);
             },
             errorHandler:function(eMessage){
                 alert(eMessage);
             }
         });

setValues expects java Object in the java tier setValues期望java层中的java对象

You have to use dwr converters. 您必须使用dwr转换器。 Follow this link, this article has described in detail what you need 点击此链接,本文详细介绍了您需要的内容

http://directwebremoting.org/dwr/documentation/server/configuration/dwrxml/converters/bean.html http://directwebremoting.org/dwr/documentation/server/configuration/dwrxml/converters/bean.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM