简体   繁体   中英

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

You have to use dwr converters. Follow this link, this article has described in detail what you need

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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