• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 728
  • Last Modified:

How can i set timeout in my jsp page so that after every interval it goes to struts action to check some status

How can i set timeout in my jsp page so that after every interval it goes to struts
action to check the status of something and then come back if it is not done or if done go to another page which is written in the action to which it is going
0
SunScreenCert
Asked:
SunScreenCert
  • 3
3 Solutions
 
Murali MurugesanFull stack Java developerCommented:
Use javascript function settimeout('<func name>',<msec>);

in the function submit the page to the desired action url.


-Murali*
0
 
Murali MurugesanFull stack Java developerCommented:
<script>
setTimeout('refreshPage()', 25 * 60 * 1000); // for 30 mins

function refreshPage(){
        document.frm.action ="something.do"l;
        document.frm.submit();
}
</script>


In your action do whtever checking you need and then redirect back to the same jsp page.

-Murali*
0
 
SunScreenCertAuthor Commented:
Can it be done with jsp code...
0
 
Murali MurugesanFull stack Java developerCommented:
what do you mean by jsp code?

Refreshing the jsp page is part of client side and not server side and javascript does it perfectly.

alternatively u can try using

<META HTTP-EQUIV="Refresh" CONTENT="5; URL=<%=request.getContextPath()%>/something.do">

-Murali*
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now