| Author |
page refresh using ajax
|
Angel Ax
Greenhorn
Joined: Jun 03, 2010
Posts: 5
|
|
hi
I am facing a problem refreshing a page ....need to use ajax
my Login page calls a servlet (LoginServlet) which has the Business logic and fetches data from the db and fwd its to a jsp page ....I am using display tag library to display data ... this table needs to be refreshed after a timegap using ajax also note that there is no event that can be used like a button or something ..
I can do it using response.setheader but that flickers the page .....
Kindly help with some ajax solutions...
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56150
|
|
What will trigger the refresh of the table? You don't say.
Do you just want it updated at regular intervals?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Angel Ax
Greenhorn
Joined: Jun 03, 2010
Posts: 5
|
|
Yes it should get updated without a trigger as my jsp page has only a table and no button or textboxes
Also note that the data is passed in a hashtable from the servlet to the jsp where it get displayed
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56150
|
|
You can use window.setInterval() to cause a timer to go off at regular intervals.
By the way, I strongly suggest adopting jQuery to do your Ajax. There are too may pitfalls to doing Ajax "by hand", and jQuery will allow you to retrive the new table from server and insert it into the DOM with one JavaScript statement.
|
 |
Angel Ax
Greenhorn
Joined: Jun 03, 2010
Posts: 5
|
|
|
can you provide some sample code how to do it
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56150
|
|
|
Nope. You write the code and we help you with it.
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: page refresh using ajax
|
|
|