Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Servlet Problem

Posted on 2001-09-10
9
Medium Priority
?
224 Views
Last Modified: 2010-04-07
I'm working on Servlet.I want to develop a screen in sucha manner that it refreshes automatically after a specified period of time(suppose 60 sec.) with new data from the database,in case if user does'nt click on "next" button in time.How can i achieve this task in servlets?
0
Comment
Question by:sandeep2k
[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
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6490736
You have to do this using JavaScript on the client side... as the servlet has no control over the page once it is presented to the user's browser.

CJ
0
 

Author Comment

by:sandeep2k
ID: 6492320
ok!! then can you please let me know how can i encorporate javascript code on servlets.?
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6493643
Well,
  Are you displaying the HTML via a Servlet (out.print) or JSPs?

  I can write a JavaScript that will start a timer.. and after 60 seconds... it will expire and refresh the page (the servlet should handle providing the new data).. the timer will only expire if the page still exists (i.e. next or any button wasn't pressed for that time)

Is that what you want?

CJ
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:sandeep2k
ID: 6503086
yes!!and also please let me know how can i encorporate javascript code with in servlet code.as i am using servlet(out.println) for displaying HTML page.
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 80 total points
ID: 6505575
Using JavaScript:
<head>
<script language="JavaScript"><!--
function executeTimer() {
if (document.images)
    location.reload(true); // forces a reload from the server
else
    location.href = location.href;  // just reloads the page
}
//--></script>

</head>

<body onLoad="tID = setTimeout('executeTimer()',1000*60)"

OR you can try this meta refresh:
Assuming the name of your servlet/jsp is:
myPage.jsp
<meta http-equiv="refresh" content="60 ;url=myPage.jsp">

CJ
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7241904
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&

0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7243877
IMHO, I provided a valid solution, so if the pts are awarded, they should go to me.

CJ
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7864349
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to cheekycj

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
0
 

Expert Comment

by:DigitalXtreme
ID: 7954063
answer force-accepted per recommendation

DigitalXtreme
CS Moderator
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

610 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