Results 1 to 2 of 2

Thread: Json to Java Deserialization problem

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Vote Rating

    Default Json to Java Deserialization problem


    I am using DirectJNgine along with ExtDirect but I am badly stuck in a problem. We have a requirement of calling a serverside method in clientside. Ex.

    ClientSide method:

    ServerMethod.resolver(jsonDaaaata,"abcde", function(result, e) 
      var t = e.getTransaction();
    Serverside direct method is :

     public void resolver(JsonElement companies, String commandName)
      System.out.println("we r in resolver method of client = ");
    Now in clientside method, "jsonDaaaata" may be any simple, complex, very complex json object or may be json array at run time and in serverside the method must have first parameter of some special datatype which can accept all types of Json object sent from the clientside.

    I have allready used following datatypes as a parameter on serverside method, but got following issues:
    JsonObject: Control goes into the serverside method but while watching "companies " in resolver() method in debug mode, it does not have value sent from the client side.
    JsonElement: Unable to invoke no-args constructor for class
    JsonArray: Control is not coming in the serverside method i.e. resolver().

    So, please is there any datatype that we can use as a parameter in serverside method like resolver() so that it can accept any json data sent from client.

  2. #2
    Ext JS Premium Member
    Join Date
    May 2009
    Barcelona (Spain)
    Vote Rating


    Read the User's Guide -either for 1.3 or 2.0 alpha 1.

    There is a "Handling JSON data directly" chapter there, it might help.
    Pedro Agull, Barcelona (Spain) - at
    Agile team building, consulting, training & development
    DirectJNgine: - Log4js-ext:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts