[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2012-03-28
9
Medium Priority
?
406 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
9 Comments
 
LVL 51

Accepted Solution

by:
Ted Bouskill earned 1200 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 1200 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
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 800 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 800 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 1200 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

649 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