1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    37
    Vote Rating
    0
    jksnu is on a distinguished road

      0  

    Default Json to Java Deserialization problem

    Json to Java Deserialization problem


    Hi,

    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:

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

    Code:
    @DirectMethod
     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 com.google.gson.JsonElement.
    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
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default


    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)
    Agile team building, consulting, training & development
    DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi