• Post Reply Bookmark Topic Watch Topic
  • New Topic

how a servlet automatically refreshing  RSS feed

 
sai prasanna
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

how can a servlet automatically updated by its data without refreshing?

thanks in advance
saiprasanna
 
java bab
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sai prasanna:
[QB]hi,


i think there is no posibility to update servlets without refreshing.
if anybody know, plz snd reply.

thanks,
javabab.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"RRRR",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sai prasanna:
hi all,

how can a servlet automatically updated by its data without refreshing?

thanks in advance
saiprasanna


The new BUZZ word in technology AJAX is the answer.
By using AJAX, part of page can be updated instead of refreshing (reloading) whole page.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java bab,

Thank you for changing your screen name.
Unfortunately, you still haven't read our naming policy.
Your name must not be obviously ficticious.

Please go back and fix it again.

Thank you.
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can a servlet automatically updated by its data without refreshing?

This question suggests to me that you don't fully understand the role of a servlet... a servlet generates a one-off response when requested. It doesn't maintain a persistent connection with the client and therefore keep feeding data back*... It is much more like a buffer which builds a response and then sends it all back at once.

A servlet typically gathers the data it needs only when it has to service a response using that data. It shouldn't be 'refreshed' every time that data changes (this is grossly inefficient anyway in the case where you have more refreshes than requests!). If you are maintaining persistent database connections in your servlet, that's fine, but it should only be necessary to check for new data each time the servlet is invoked by a client request.

The only way to force a client page to refresh is to use client-side scripting like JavaScript - and if it's only certain data you need to refresh on the page, then AJAX might be the answer.


* Note that this statement is distinct from saying the container may keep an HTTP session with the client; that's a different story. But HTTP is still stateless (no permanent connections unlike FTP or TCP).
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Server push will help you. This technology is known for about 8 years, and finally people started using it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!