Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Feb 2011
    Location
    Chennai
    Posts
    3

    How to JSON Object in Java Adapters as input

    Hi,

    Currently looking for some examples in Java adapters which will use JSOn as Input and to pass to HTML . Any One can help me out on this.

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    hi,

    I'm not sure I understood your problem.

    if you have an object you want to pass as json to the client you can simply pack it into a string on your data adapter and pass it as the value of a field; then you'll receive it as an update on your client where you'll have to deserialize it.

    please note that doing so youíll lose some of the optimizations offered by Lightstreamer protocol. For example, the merging algorithm (of the MERGE mode) is applied to the entire object instead of being applied to each single field, so that every time a property within the json object changes, the entire object is pushed to the client, not only the changed value.
    A more efficient way would be to map each of the properties of the json object to single fields. This may or may not be feasible depending on how structured is the object.


    please check also the Server-Side section of this blog post: http://goo.gl/a40yR
    the approach shown is based on AMF objects, btw excluding the serialization process (ie the toAMF method) it applies to your case too.

  3. #3
    Member
    Join Date
    Feb 2011
    Location
    Chennai
    Posts
    3

    Re: JSON in Java

    Hi Mone ,

    My Problem is in Feed simulator there are set of String arrays which is used to feed to client instead i need to request some Json service to get the JSON and to parse again i need to store as java arrays and pass to the client , if possible can u give me a sample coding example on this.


    Quote Originally Posted by Mone
    hi,

    I'm not sure I understood your problem.

    if you have an object you want to pass as json to the client you can simply pack it into a string on your data adapter and pass it as the value of a field; then you'll receive it as an update on your client where you'll have to deserialize it.

    please note that doing so youíll lose some of the optimizations offered by Lightstreamer protocol. For example, the merging algorithm (of the MERGE mode) is applied to the entire object instead of being applied to each single field, so that every time a property within the json object changes, the entire object is pushed to the client, not only the changed value.
    A more efficient way would be to map each of the properties of the json object to single fields. This may or may not be feasible depending on how structured is the object.


    please check also the Server-Side section of this blog post: http://goo.gl/a40yR
    the approach shown is based on AMF objects, btw excluding the serialization process (ie the toAMF method) it applies to your case too.

  4. #4
    Member
    Join Date
    Feb 2011
    Location
    Chennai
    Posts
    3
    Hi Mone ,

    My Problem is in Feed simulator there are set of String arrays which is used to feed to client instead i need to request some Json service to get the JSON and to parse again i need to store as java arrays and pass to the client , if possible can u give me a sample coding example on this.

  5. #5
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    I'm sorry but we don't have any example code that does what you need.

    btw this is a general java problem, you should be able to easily find some example code elsewhere on the net.

    Try starting from here: http://www.json.org/java/

 

 

Similar Threads

  1. Replies: 6
    Last Post: December 7th, 2010, 10:26 AM
  2. Replies: 3
    Last Post: November 11th, 2010, 08:09 AM
  3. LightStreamer with AMF object support
    By sachinpatel2 in forum Client APIs
    Replies: 1
    Last Post: September 10th, 2010, 11:01 AM
  4. Replies: 1
    Last Post: January 18th, 2010, 04:27 PM
  5. Replies: 1
    Last Post: March 2nd, 2007, 12:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 07:46 AM.