Solved

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

Posted on 2009-07-09
4
720 Views
Last Modified: 2013-11-24
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
Comment
Question by:SunScreenCert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 13

Assisted Solution

by:Murali Murugesan
Murali Murugesan earned 500 total points
ID: 24819316
Use javascript function settimeout('<func name>',<msec>);

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


-Murali*
0
 
LVL 13

Accepted Solution

by:
Murali Murugesan earned 500 total points
ID: 24819898
<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
 
LVL 2

Author Comment

by:SunScreenCert
ID: 24825003
Can it be done with jsp code...
0
 
LVL 13

Assisted Solution

by:Murali Murugesan
Murali Murugesan earned 500 total points
ID: 24829180
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
mapBully challenge 6 178
Non-recursive backtracking, using a stack 1 248
stackato and cloud 4 104
login form jsp example 2 55
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question