Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Jan 2011
    Location
    none
    Posts
    5

    Push data based on url parameter

    Hello

    I've a problem with getting url param in the adapter.
    For example:
    user1 access http://localhost/test.jsp?id=1
    user2 access http://localhost/test.jsp?id=2
    And the data that push to browser is depends on the parameter id.

    How to get the param id in the adapter?

    Thanks,
    Semua

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

    as you're using a jsp file I guess that on localhost:80 you have a servlet container handling requests. Is this correct?

    there are many ways you may want to handle the id parameter; I suppose that in your case the id represents an item to be subscribed to. In that case you may let your jsp create (server side) a piece of javascript code that in turn creates (client side) a Table using such id as group.

    The final code generated by your jsp will be something like this:


    obviously you may use a different Table class (see APIs) and also need the code to handle the Lightstreamer connection to the server, the handling of the data and so on...
    Please refer to our demos and to the client APIs for details on how to implement a complete client. You may also want to check the Web Client Dev.pdf that comes with our distribution under LS_HOME/DOCS-SDKs/sdk_client_web/doc (or LS_HOME/DOCS-SDKs/sdk_client_html/doc on newer versions)



    HTH

  3. #3
    Member
    Join Date
    Jan 2011
    Location
    none
    Posts
    5
    Hello,

    Finally, I can get the param value, thanks for the clue

    Btw, to push the data to client, in the push server is running a timer in periodical time.
    For example, if push server is accessed by 1000 users, it cause 1000 timers/thread running in the server. The data that push to every user is different, depends on his profile.
    Does this method cause a performance degradation?

    Thanks,
    Semua



    Quote Originally Posted by Mone
    Hi,

    as you're using a jsp file I guess that on localhost:80 you have a servlet container handling requests. Is this correct?

    there are many ways you may want to handle the id parameter; I suppose that in your case the id represents an item to be subscribed to. In that case you may let your jsp create (server side) a piece of javascript code that in turn creates (client side) a Table using such id as group.

    The final code generated by your jsp will be something like this:


    obviously you may use a different Table class (see APIs) and also need the code to handle the Lightstreamer connection to the server, the handling of the data and so on...
    Please refer to our demos and to the client APIs for details on how to implement a complete client. You may also want to check the Web Client Dev.pdf that comes with our distribution under LS_HOME/DOCS-SDKs/sdk_client_web/doc (or LS_HOME/DOCS-SDKs/sdk_client_html/doc on newer versions)



    HTH

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    obviously all the load in the adapter is load on the server process.

    you may want to optimize the thread usage using java.util.concurrent classes

    also, if the data is not completely user-customized but you simply have different users that can see different sets of data you may want to use the getItems method to translate the id with the set of items the user can see ( set of data -> item ).

    In any case you may want to check that the id a user is subscribing is his own. You can implemt your MetadataProvider to do such checks

 

 

Similar Threads

  1. New Dojo Demo based on LightstreamerStore
    By Alessandro in forum Client APIs
    Replies: 8
    Last Post: October 8th, 2012, 10:33 AM
  2. Bad request: LS_Session parameter missing
    By lstest in forum Adapter APIs
    Replies: 5
    Last Post: February 26th, 2010, 03:47 PM
  3. Replies: 4
    Last Post: January 30th, 2008, 02:47 PM
  4. Replies: 6
    Last Post: December 12th, 2007, 05:45 PM
  5. Replies: 2
    Last Post: December 4th, 2007, 04:32 AM

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 10:48 PM.