Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Real time data using JSP

 
Angela D'souza
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to get realtime updated data from database using socket listener object so user on front end doesn't have to click on refresh button to display updated data.
Can I get real data using JSP(which will call socket listener object which call data access object)?
Thanks,
angela
 
Rajeev Ravindran
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi angela,
why r u going for sockets in JSP ?? cant u refresh the jsp page automatically and call a bean to display the database value dynamically ??
thanks
raj..

SCJP2
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Angela D'souza:
Can I get real data using JSP(which will call socket listener object which call data access object)?

Listening a socket for a long time in the middle of a HTTP request is generally a bad idea... If the client doesn't timeout the connection, your appserver will.
I'd suggest using some kind of polling scheme. The first that comes to mind is the HTML refresh header already suggested.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic