943,095 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 707
  • JSP RSS
Mar 15th, 2010
0

Can JSP do "live feed"?

Expand Post »
As above, can JSP do "live feed", as in if the DB has newly added items, a display page will auto add this item without polling the DB.
Or this has to be done other language?

Thanks in advance.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gt.ang is offline Offline
2 posts
since Mar 2010
Mar 15th, 2010
0
Re: Can JSP do "live feed"?
JSP is based on http. Http is a request/response mechanism.

Whether it is possible at all depends on whether the database presents a mechanism by which it can send automatic information about updates to listening clients.
Personally I'd never do such a thing. A polling mechanism works a lot better and is less of a drain on system resources.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Mar 15th, 2010
0
Re: Can JSP do "live feed"?
If I use polling mechanism, won't it be more of a drain to system resource if I poll every second?

Can use AJAX?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
gt.ang is offline Offline
2 posts
since Mar 2010
Mar 20th, 2010
0
Re: Can JSP do "live feed"?
As already mentioned, HTTP is a request/response protocol; what this implies is that the server can push updates/send a response only when requested. So you can two choices to update your data on screen:
- Use long lived connections to implement server push. The way this normally works is that the initial request which loads the data doesn't close the connection.
- Use polling as already mentioned.

Both approaches end up consuming resources. Server push keeps all the connections occupied which might lead to the server running out of connections if a lot of clients are using your application. Polling leads to the server being bombarded with constant requests even when there is no data which can be pushed to the client.

You might want to review your requirements and decide which approach suits you best. Here is an interesting read about the different async technologies BTW.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,871 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: How to select row from <rich:extendedDataTable/>
Next Thread in JSP Forum Timeline: how to connect derby database to jsp





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC