Solved

How do I implement a Server side data push in a java spring jsf2 web project

Posted on 2012-03-28
9
353 Views
Last Modified: 2014-09-07
How do I implement a server side data push in a java spring jsf2 dynamic web project with jquery functions working on front-end web page.
I want to get server side updates without a user interaction into the facelets xhtml front end page which should display cell by cell updates to a html table.
Expectation is a complete working code example.
0
Comment
Question by:Swarnajith
  • 3
  • 2
  • 2
9 Comments
 
LVL 51

Accepted Solution

by:
Ted Bouskill earned 300 total points
ID: 37782499
You cannot push from a web server.  The HTTP protocol does not support it.  You have to write JavaScript or a Java applet to poll the server for updates.

As soon as a page is loaded by the browser it disconnects from the web server.  It's a common misconception that the browser stays connected to the server like typical client/server application.
0
 

Author Comment

by:Swarnajith
ID: 37782568
I can't exactly say you are correct or wrong. But I have used IcePush in order to do this and it actually brings updates from server to front-end as well and it updates whole java data Lists rather than html table individual cells. The problem I'm facing with that technology is as an when a server update happens my User Interface's JQuery functions malfunction and the JQuery UI styles vanishes. Because of that i'm searching for any other ways in doing this.
0
 
LVL 51

Assisted Solution

by:Ted Bouskill
Ted Bouskill earned 300 total points
ID: 37787676
IcePush is AJAX which is actually polling JavaScript exactly as I stated.  Read this quote from their website:

"The ICEpush Core implements the asynchronous notification mechanism using long polling over HTTP."

I can 100% guarantee that the browser client can only pull from the server.  They are simulating a push using polling.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 200 total points
ID: 37790734
with html5 + websockets you can do a server push, see RFC 6455 or http://dev.w3.org/html5/eventsource/
IIRC vrowser support is lazy and the technology has a lot of security implications
0
 

Author Comment

by:Swarnajith
ID: 37790753
But I cannot use HTML 5 because its not compatible in every browser so far.

Can you give me an example of how to do a jquery ajax poll with jsf. It'll be more helpfull.
Thanks for the help so far.
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 200 total points
ID: 37790773
> Can you give me an example of how to do a jquery ajax poll with jsf.
will be hard as such a simple XHR call first needs to know what you've implemented server-side and then your jequery needs to know how and where the server response should be displayed
I assume it's better you consult your prefered search engine and modify the code snippets you'll find for your desires
0
 
LVL 51

Assisted Solution

by:Ted Bouskill
Ted Bouskill earned 300 total points
ID: 37791369
Guys I just wanted to comment that technically if you dig deep enough it isn't a true *PUSH* in HTML5.  The client doesn't sit with an open port waiting for the server to connect to push an event to it.  Deep down it's still the browser polling to server to see if there is a queued event waiting to be processed.

The server doesn't maintain a list of connected client IP's that it then processes in a queue to send messages to each connected browser.  That overhead would be too much for the server and then someone could create a new type of DoS attack where they added a load to the push queue to kill server performance.

Nor does the clients maintain a permanent socket connection which would once again be a candidate to overload the server.  The basic HTTP protocol still is the same.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now