Implementing Server Push

How can i implement a server push in my jsp pages?
any sample code would be appreciated.
The server pushes the data to the jsp when the
database changes because of an update.
Thanks

Http is a stateless protocol and cannot maintain a connection to the server. I am working on a project now that has the same type of requirement and we are using pushlet technology. You should have a look at the following
www.pushlets.com
Hope this helps
SD

Similar Messages

  • Which tech can replace applet to implement server push model

    We have implemented server push real-time datas to client with Applet+JSObject. but there is a thing we can not do well. When some users have intalled jre not same with our default, the applet run fail. So we are finding another tech to implement server push model.
    Any suggestions!
    client polling to emulate server push is cancelled.
    Thanks very much!

    linuxhippy wrote:
    well you can do it with polling - i have implemented such a system and it works very well.how many clients do your system support ?
    polling period ?
    what third-party libs ?

  • Implementing Server Push using LCDS 2.6

    Hi All,
    We have created an application where we are using polling to get certain constant updates. Now this polling is client polling wherein the client polls the server at regular intervals to get the fresh data for certain actions.
    Now we wish to take this to another level and implement Server Data Push so that the client does not keep polling unnecessarily and the server notifies the client as and when the data gets updated with the server. For this we have the DataService Transaction class that needs to be implemented.
    But there are a couple of questions that are in my mind regarding this technology. It would be great if someone could answer them.
    My questions are:
    1) Does the LCDS server know which client to push data to in case of multiple clients looking at the same data scenario. e.g. Two clients A and B are looking at the same data. A performs an action and that action needs some time to get completed at the server. Now in case we use Server Data Push, will the LCDS be intelligent enough to send the message on completion of the requested activity to only A and not B.
    2) In order to push data to the client, the server will invoke some method which will return the desired data to te client. How do we keep the parameters registered with the server that this method would need while getting invoked. SInce, the call to the method will not be client initiated, how does the server know what parameters to be passed to the method in order to invoke it. How will this work in a multi-user looking at the same data/screen scenario.
    The answers to these questions will really help us. In case anyone is well versed with this technology, please pitch in to give your inputs.
    Many Thanks.
    Regards,
    Shally

    Hi,
    As also, suggested by you, we were thinking of using an RTMP channel only for this since its a two way socket that establishes a communication channel between the client and the server and then helps keep messages moving to and fro.
    We have successfully implemented RTMP channel and achieved the following functionalities.
    1) A client initiated change which gets propagated to the server and then to all the clients.
    2) Server push to all the clients.
    Now our last step is to implement data push to a particular client. As told by you, we will use the client id but we have some doubts and questions regarding this since we do not have the code examples or anything that could help us in implementing the same.
    I would therefore request you to kindly lead us on the following fronts:
    1) Is the client id the one that is part of the request- response thread, I saw a client id being printed in the logs when a request is made and the response comes.
    2) What code needs to be written on the server side to extract this client id once a call is made so that it can keep this client id with itself to push a message later on.
    3) What methods or API are available to be used to push this message to a particular client? Do we need to call the fill method of a particular client using the client id parameter and inform the client that its requested job has been done.
    For (3) is the Messaging(Publish and Subscribe model) the right way to go??
    It would be great if you could provide us some code snippets just to give us an idea from where we can take it up ourselves.
    Looking forward to hear from you.
    Many Thanks,
    Shally
    Message was edited by: testing34

  • Server push with Javamail: idle() blocks

    Hi,
    today I tried to implement server push functionality in my mail application via Javamail.
    I did this by calling the following method everytime Javamail creates a new Folder instance for me:
    private void activateServerPush(Folder f) {
         if (f instanceof IMAPFolder) {
              final IMAPFolder ifo = (IMAPFolder) f;
              ifo.addMessageCountListener(new MessageCountListener() {
                   @Override
                   public void messagesAdded(MessageCountEvent arg0) {
                        DebugPrinter.print(this, "messagesAdded event called");
                        clear(false, true); // Clear cache
                        onMessageCountChanged();
                   @Override
                   public void messagesRemoved(MessageCountEvent arg0) {
                        DebugPrinter.print(this, "messagesRemoved event called");
                        clear(false, true); // Clear cache
                        onMessageCountChanged();
              MyThread thread = new MyThread() {
                   @Override
                   public void run() {
                        while (true) {
                             DebugPrinter.print(this, "Before idle");
                             try {
                                  ifo.idle();
                                  DebugPrinter.print(this, "After idle");
                             } catch (MessagingException e) {
                                  // TODO Auto-generated catch block
                                  e.printStackTrace();
                             DebugPrinter.print(this, "After idle try");
              // Start thread
              ServletThread.EXECUTOR_SERVICE.submit(thread);
    }Now, when I run the code above, I only get "Before idle" as output.
    The rest won't be printed so it seems like idle() is blocking.
    Also, the event listener messagesAdded(...) are not called. I tried this by sending an email to myself but nothing happens.
    What's wrong?

    Hi Bill and thanks for your reply.
    How does the idle command (line) look line in the debug output?
    I simply did a full text search for the word "idle" (ignore case) of everything that got printed to console and only found this:
    DEBUG: mail.imap.minidletime: 10
    * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS AUTH=PLAIN AUTH=LOGIN
    A2 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS] Logged in
    Also, I noticed that the line "Before idle" (See source code in my initial posting here) gets printed but AFTER that line I can't find anything else that could refer to the idle command.
    When I leave Apple Mail (my default native email client on my computer) open, the email that I sent gets correctly (instantly) pushed.

  • Server-Push

    I read somewhere that Flex Data Services provides Server-Push
    functionality. That is, the server starts a conversation with the
    client. It's obvious that, In order to such thing ocurr, there has
    to be a persistent connection between server and client.
    I've being reading about Data Management Service to learn how
    to implement this Server-Push and all I see is about a method
    called Fill() that is thriggered from the client and syncronizes
    it's data with the server. But it's not server-push
    Does it really exist?

    Hi,
    When you create a DataService and fill your collection. The
    collection becomes managed. You don't have to call fill again if
    there is any change in the data. Server pushs updates to clients
    when the client's dataservice is using rtmp channel. It is a live
    connection between the server and the client. For example,
    you fill(collection, "hqsql", from products where price <
    100). If one of the product's price increases, server push a
    message to your collection to remove it. If a product's product's
    price decrease, it will be added to the collection. The push is
    happened based on your fill method.
    William Chan

  • Server Push in Servlets

    Hi AnyOne!
              I have a servlet, and a database . If a column in my table gets updated I
              want all of my clients who are connected to it , to see the refreshed value
              without click any refresh/Reload button on the browser. A kind of
              Server-Push.
              That is, If one client makes changes, then all of the other clients on the
              web should get intimated.
              How can I achieve this ?
              thanks
              vikas
              

    I read the OP's message and imediately thought oh, cool, MVC candidate :-)          If I wanna talk about MVC I would prefer Sun's Design Patterns group.
              Kumar.
              [email protected] wrote:
              > "Mettu Kumar" <[email protected]> wrote in message
              > news:[email protected]...
              > > Ryan,
              > >
              > > I was not commenting on MVC pattern. I am talking about the problems
              > > pushlets implementation could potentially cause.
              >
              > Mettu, we completly crossed paths my friend. I read the OP's message and
              > imediately thought oh, cool, MVC candidate :-) Silly me! I understand what
              > you are talking about now :-)
              >
              > > 1. If you are serving 10,000 clients, probably a given instance your
              > server will
              > > be serving 100 or 1000 of the them. but with pushlets you have 10, 000
              > > conenctions open siumultaneously and your server is serving all the client
              > 100%
              > > of the time.
              >
              > No, you're right that isn't good.
              >
              > > Do you think this would scale? Imagine the number of threads on server.
              > > 2. This could potentially bring down the web server you are using.
              > >
              >
              > It would scale right up to the time the server came crashing down :-) Yes,
              > if the server kept a single connection, thread of execution, open to every
              > client while the client was running that would be not so hot indeed,
              > especially if your clients increased exponentially. This is precisely why I
              > like the callback method on each client, kind of a pain to implement though.
              >
              > >
              > > Kumar.
              > >
              > > [email protected] wrote:
              > >
              > > > I wasn't referring to the article on pushlets you mentioned when I said
              > the
              > > > idea of MVC was a valid one, nor have I read the article as I respond
              > but
              > > > heres the idea I was describing which is based on the concept of MVC.
              > It
              > > > provides perfectly for the scenario the OP described IMO. I think, at
              > least
              > > > based on what I've seen, that the notion of MVC in the J2EE sector is
              > used
              > > > mostly as a means to seperate business logic from presentation logic.
              > It
              > > > doesn't allow for any mechanisms to notify the ``views" when data
              > ``model"
              > > > changes. This is no big deal I guess for most applications but it does
              > > > break the MVC paradigm IMO. To aleiviate this problem we incorporate an
              > > > observer pattern to notify each subscribing view when the model changes.
              > > > There really isn't any difference in my mind between push and pull where
              > > > pull is a standard RFC 2616 request and push is a simple callback to the
              > > > object registered with the controller (servlet, jsp). If the server can
              > > > handle a thousand or so concurrent requests why couldn't it handle a
              > > > thousand concurrent callbacks. You could probably improve this by
              > > > multi-threading the controller. Just some thoughts I would like to hear
              > > > yours :-)
              > > >
              > > > ~Ryan
              > > >
              > > > "Mettu Kumar" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > > Ryan,
              > > > >
              > > > > Did you ever try to use to Pushlets serving thousands of clients?
              > > > > Why did you think its a good design? If you feel its a good design,
              > let
              > > > us
              > > > > know whats good about it.
              > > > >
              > > > > Kumar.
              > > > >
              > > > > [email protected] wrote:
              > > > >
              > > > > > "Mettu Kumar" <[email protected]> wrote in message
              > > > > > news:[email protected]...
              > > > > > > Vikas,
              > > > > > >
              > > > > > > There was a article about the same in java world a while back.
              > > > > > > http://www.javaworld.com/javaworld/jw-03-2000/jw-03-pushlet.html
              > > > > > >
              > > > > > > But I believe this is bad design. I don't think using opened HTTP
              > > > > > Connections
              > > > > > > to do a real time operation is not a good Idea. What if you are
              > > > serving
              > > > > > couple
              > > > > > > of hundred clients?
              > > > > > >
              > > > > > > Kumar.
              > > > > > >
              > > > > >
              > > > > > It's a perfectly valid design. OP, check out MVC and the observer
              > > > design
              > > > > > pattern I think you'll find what you're looking for there.
              > > > > >
              > > > > > ~Ryan
              > > > > >
              > > > > > > Vikas Jolly wrote:
              > > > > > >
              > > > > > > > Hi AnyOne!
              > > > > > > >
              > > > > > > > I have a servlet, and a database . If a column in my table gets
              > > > updated
              > > > > > I
              > > > > > > > want all of my clients who are connected to it , to see the
              > > > refreshed
              > > > > > value
              > > > > > > > without click any refresh/Reload button on the browser. A kind
              > of
              > > > > > > > Server-Push.
              > > > > > > > That is, If one client makes changes, then all of the other
              > clients
              > > > on
              > > > > > the
              > > > > > > > web should get intimated.
              > > > > > > >
              > > > > > > > How can I achieve this ?
              > > > > > > >
              > > > > > > > thanks
              > > > > > > > vikas
              > > > > > >
              > > > >
              > > > >
              > >
              

  • How can I implement GCM push notifications in AIR?

    How can I implement GCM push notifications in AIR? How can I implement GCM in Android using flex?

    You have 2 ways, first is buy the ane, are alot such as: http://myappsnippet.com/gcm/ or review the open in: https://github.com/freshplanet/ANE-Push-Notification or http://afterisk.wordpress.com/2012/09/22/the-only-free-and-fully-functional-android-gcm-na tive-extension-for-adobe-air/ , that for client side, for server side you can buy in http://urbanairship.com/ or enter in the world of build your own pisblisher server, in this case you need to read android and ios and blackberry notification, each one has different methods.
    Also, here you have more information: http://forums.adobe.com/message/4626292
    looks good.

  • Using the new Data/Services generation with server push

    Have moved my Flex/BlazeDS app (which uses Blaze AMFChannel for request/response messages and StreamingAMFChannel for server push messaging) from Flex Builder 3 to Flash Builder 4. The new Data/Services works fine to generate service classes and value objects for the request/response messages, question is can it provide any help setting up a messaging consumer and value objects for the pushed data?
    rick holland

    I am so sorry - I meant AirPort Express - not extreme - but it's moot since I missed the point of your post - you want two outputs - and one to not be digital.
    For what it's worth - I still think the express might be your best bet.
    http://www.apple.com/airportexpress/airtunes.html
    It has combined digital/analog out - you plug in one and it switches the output depending on which connection is inserted. I would expect a very short wait until everything accepts digital input - expecially for people who want good sound quality. If you have to go digital to analog outside of the receiver/amp (where it really belongs) - why not let it be the express sitting right next to where you want the second "receiver" to be...

  • Support for SWF Verification in the reference implementation server

    The Server for Protected Streaming provides a way to configure a whitelist of allowed SWF hashes.  However, from what I can tell, the reference implementation server does not have this capability.  Any suggestions on how to implement SWF Verification in the reference implementation server ?

    To use SWF whitelists with the Reference Implementation, set the SWF  whitelist in a policy, and use that policy when packaging the content.  When issuing a license, the Reference Implementation will use whatever  restrictions were specified in the policy at packaging time.  Alternatively, since the Reference Implementation ships with source  code, you can modify the server so you can specify the SWF whitelist  information at the time the license is generated.

  • Server Push redirecting to a pre-existing JSP

    Question:
    Has anyone tried to create a Server Push servlet that can be used to serve up pre-existing JSPs?
    Is it even possible for a servlet to serve a pre-existing JSP or does the web page code have to be embedded within the servlet?

    Hi, do you mean you want to redirect to another JSP?
    you could use the "sendRedirect" method in the HttpServletResponse object.
    for example:
    public MyServlet perform(...HttpServletRequest request, HttpServletResponse response)
         throws IOException, ServletException {
      String redirectTo = "http://www.companyname.com/index.jsp";
      response.sendRedirect(redirectTo);
    }something like that....

  • Server Push in JSP

    Hi AnyOne!
              I have a jsp, and a database . If a column in my table gets updated I
              want all of my clients who are connected to it , to see the refreshed value
              without click any refresh/Reload button on the browser. A kind of
              Server-Push.
              That is, If one client makes changes, then all of the other clients on the
              web should get intimated.
              How can I achieve this ?
              thanks
              vikas
              

    Vikas,
              There was a article about the same in java world a while back.
              http://www.javaworld.com/javaworld/jw-03-2000/jw-03-pushlet.html
              But I believe this is bad design. I don't think using opened HTTP Connections
              to do a real time operation is not a good Idea. What if you are serving couple
              of hundred clients?
              Kumar.
              Vikas Jolly wrote:
              > Hi AnyOne!
              >
              > I have a jsp, and a database . If a column in my table gets updated I
              > want all of my clients who are connected to it , to see the refreshed value
              > without click any refresh/Reload button on the browser. A kind of
              > Server-Push.
              > That is, If one client makes changes, then all of the other clients on the
              > web should get intimated.
              >
              > How can I achieve this ?
              >
              > thanks
              > vikas
              

  • Server Push Intermittent message loss

    We are using LCDS 2.6 and using the RTMP port for the server push. However, at times the notifications in between the server to clients goes missing. It works pretty good at times and after some time, it does not shows notification.
    We are using DataTransactionServices for pushing the data from LCDS to the Flex clients.

    Hello,
    We are still facing the intermittent issue with LCDS. Following steps has been done:
    1. We tried different values in DataDestination property like autoSyncEnbaled , cache items and some other properties, but it did not work.
    2. We analysed LCDS logs in log file and found that :
       a. Java Code is pushing updated state to LCDS and message is also routing to client.
       b. At client side UI is receiving old data from LCDS.
    Do you have any idea, why is this happening?
    Gaurav Shukla
    Senior Technical Architect -ADCOE
    HCL Technologies Ltd.
    SEZ, Plot No. 3A, Sector 126, Noida 201301, U.P. (India)
    Mob: +91-9899 89 9189
    www.hcltech.com<http://www.hcltech.com>
    www.hcl.com<http://www.hcl.com>
    cid:[email protected]

  • Server push / Client pull

    Hi,
    Please let me know about Server push and Client pull . When this has to be needed. please explain.
    Thanks in advance.

    google ...

  • Server Push   pushing data to clients

    Need some ideas.
    I have been hunting around for info on a simple/clean method
    to push data out to clients. Client could be a Java application or maybe an applet. Solution must easily go through firewalls
    In either case I want the client to startup, register with the server
    and start receiving data. Without further user intervention.
    Whatever, scheme is used must be able to deal with network
    disconnects.
    I have looked at Pushlets, the article was 2 years old and I don't see
    any recent postings on Pushlets. So maybe that is not the way to go.
    I guess my other choice is JMS. SonicMQ?
    Server Push using Netscape?
    Or are there other options.
    Many thanks for your feedback.
    KD

    Have you considered J2ME.
    J2ME and WAP Push can be complementary. but for WAP Push to work the devices or the browsers in the devices have to be WAP 1.2 complaint.
    more details can be found at http://devforum.openwave.com
    hope this helps.
    williams

  • Error getting while implementing server proxy

    Hi All,
             I am implementing server proxy using synchronous inbound message interface.I am trying to get the purchage order details from SAP.I am giving input as PO number.While getting output of multiple rows it is showing only one row.that is the problem.If i can change the occurence of output fields its getting syntax error.
           how can i get the multiple row items from that synchronous proxy.please give me any suggestions.
    thanks,
    Kishan.

    Hi Shabarish,
        Thanks for reply.If i can change the occurence in outout structure at the time the output is not assigning to the output fields.This  is getting syntax error.
          The interface is working only for 1 occurence.
          I am assigning the output like this..
       <b>output-ES_TARGET_MSG_TYPE-ITEM-PONUMBER = it_EPSS-PONUMBER.</b>
       here it_EPSS is the table.
       ITEM-PONUMBER is the output field.
    thanks,
    Kishan.

Maybe you are looking for

  • Problem with photoshop elements 8 organiser

    Hi, I wonder if anyone can help?I have photoshop elements 8 and the organizer suddenly crashed. Now it won't open at all.

  • Second Ipod trouble

    About a year ago i bought and instaled an ipod nano (2GB) and had no problems. I recently bought a Video Ipod (U2 30GB version) and i can't seem to get Itunes to recognize that the Video Ipod is connected. i saw the "ipod is recognized in windows not

  • New iPhone 5

    My Current iphone 4 is registered with itunes on my work pc, i have just bought a laptop and will be installing itunes on it, can i register my iphone with the new itunes and will i lose all my music, apps, etc from the old one?

  • Discussion service unavailable

    I config oam with webcenter successfully. I wanna config discussion service connection at /em take the following url as reference. http://download.oracle.com/docs/cd/E12839_01/webcenter.1111/e12405/wcadm_services.htm#CHDGAICG I've checked all my step

  • What is the payment procedure from Apple?

    We have set-up a company in India to develop App. We need to know, how Apple will make payment once our App starts selling? We do not want to be double taxed in India as well in USA. What is the method in place from Apple?