Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling struts action with specified time interval using ajax

 
nick angel
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to everyone. The problem I am currently facing is the following. I have created a jsp where I wish to call a struts action using ajax. The pertinent code in my jsp is as follows:



What i wish to accomplish is to call the struts action at a specified time interval. However, the code i have written does not work. The struts action gets called a first time, but when the specified amount of time has elapsed then it just freezes.

I was hoping someon could point me in the right direction. Any help would be greatly appreciated.
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setTimeout only calls a function once.

setInterval will repeatedly call a function.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic