Don't want to re-execute applet code, when refresh browser

Hi,
I am developing online exam project, here my issue is in timer, I am creating timer in thread.sleep(1000); (ie) 1000 mili sec = 1 sec. once exam started, i am started reducing timer value. While moving to next question, I want previous Applet timer value in next page. Here i am getting initial value of each time refreshing,
example:
suppose timer running in browser like this : 00:00:46 ----> when refresh same page i need value reduce from 00:00:46, But its reload from initial value (ie): 00:00:59 in below example code.
Here is my Applet code :
import java.awt.*;
import java.util.*;
import java.applet.*;
import java.net.*;
public class myclock1 extends Applet implements Runnable
Thread t,t1;
int hour=0,minute=0,second=0;
URL targetURL;
String URLString = "http://localhost:8080/testing/examresult.jsp";
AppletContext context;
public void start()
minute = Integer.parseInt(getParameter("min"));
second = Integer.parseInt(getParameter("sec"));
context = getAppletContext();
t = new Thread(this);
t.start();
public void run()
t1 = Thread.currentThread();
repaint();
public void paint(Graphics g)
if(hour==0 && minute==0 && second==0)
try
targetURL = new URL(URLString);
catch (MalformedURLException e)
// Code for recover from the exception
context.showDocument(targetURL);
t.destroy();
t1.destroy();
this.destroy();
second--;
if(second==-1)
second = 59;
minute = minute-1;
if(minute==0)
if(hour>=1)
hour = hour - 1;
minute = 59;
g.drawString(hour + ":" + minute + ":" + second, 20, 30);
repaint();
try{
t1.sleep(1000); /// 1000 mili sec = 1 sec
catch(InterruptedException e)
In JSP Page Code:
<jsp:plugin type="applet" code="myclock1.class" height="150" width="300">
<jsp:params>
<jsp:param name="min" value="0" />
<jsp:param name="sec" value="60" />
</jsp:params>
</jsp:plugin>
How to do that, Urgent Plz help me.
Thanks in Advance,
S.Shyam.

Is it SAX, Dom, JAXB or something else you are talking about?

Similar Messages

  • How do I execute some code when a line of a table control is selected?

    Hi,
    I would like to execute some code when a line of a table control is selected.  At the moment I have to select one or multiple rows and then press enter, this forces a screen refresh and my code is executed but I would like the code to be executed as soon as any line is selected.
    I've done something like this using ALV grids and object orientated code but is there a way of doing this in a normal non-OO table control?
    Thanks in advance.
    Gill

    Hi,
    U need to declare a char1 field for marking (mark field).  This will reflect with value 'X' in your tcontrol internal table for all the selected rows. 
    Now u need to handle the okcode for enter in your PAI.
    There u need to loop through the table for all marked fields.
    There after u can do what ever u want.
    Venkat.

  • DON;T WANT TO GO TO HOME PAGE WHEN I OPEN NEW TAB

    HOW DO I STOP GOING TO HOME PAGE WHEN I OPEN A NEW TAB? I DON'T WANT TO GO TO HOME PAGE WHEN I OPEN A NEW TAB, I WANT TO SEE A BLANK PAGE, THEN I CAN PUT IN THE URL OF MY CHOICE. I ONLY WANT TO SEE HOME PAGE WHEN I OPEN FIREFOX, OR WHEN I SELECT IT USING THE HOME PAGE BUTTON.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • I have iPhoto 08 and have been happy with it. Don't want to upgrade. But suddenly, when I click on an event, instead of all the photos, I just get one- enlarged- and cannot move to the next one. The photo just jumps up or down.  How to solve?

    I have posted "submit" twice and keep getting requests to submit again.  Now being asked to write a summary! Here we go.  I have iPhoto 08 and am happy with it.  Don't want to upgrade. But suddenly when I click on an event, instead of getting all the photos, I just get a large version of one photo and cannot move on to the others.  The right arrow will not move it and the photo just jumps around.

    Note the slider bottom right of the iPhoto Window. Drag it left.

  • How do I get iTunes to ONLY open in Mini Player? I don't want the entire iTunes interface opening when I double click on an Mp3 file.

    How do I get iTunes to ONLY open in Mini Player? I don't want the entire iTunes interface opening when I double click on an Mp3 file.

    Over 6000 people have downladed the script to get around this after a fashion. Is it still required?

  • How to make a scroll animation constantly fixed after scrolling? I want the animation to Start when I scroll down, but I don't want the animated thing to disappear when I scroll up again.

    How to make a scroll animation constantly fixed after scrolling? I want the animation to Start when I scroll down, but I don't want the animated thing to disappear when I scroll up again.
    I know how to start the animation by scrolling down, but I simply want it to stay there after it. Could you help me please, guys?

    Hi Tom,
    There is no native feature in Muse to achieve this.
    Regards,
    Aish

  • I don't want previous info to pop up when I'm filling in forms. How do I keep that from happening?

    When I fill in forms, suggestions (previous answers) pop up. I don't want this to happen.
    e.g. when I began typing my email address to register, firefox gave me the address as a choice

    Do a malware check with some malware scanning programs.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br />
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    * "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • Execute custom code when grabbing an instance from inbox

    Hey Guys,
    I work with ALBPM 5.7 and we need to execute some basic custom code (such as updating a custom db) when an instance is grabbed from the inbox. Is there a way to do this?
    I would think there would be a handler or something available, that we can plug in.
    Basically, when an instance is grabbed from the inbox, it does get assigned to the participant. I need to execute some code so the participant name goes to the custom db too. Any suggestions?
    thanks

    Hi,
    Adding a screenflow just like when you add a screenflow for an Interactive activity.
    1) right mouse click the Grab activity
    2) click "Main task"
    3) select "Screenflow" from the implementation type dropdown
    4) click the "New" button.
    5) name the screenflow
    6) click "Next"
    7) decide what variables you want to come into (usually just the BPM object in your process) and what you want to go out of the screenflow (usually just the BPM Object, result and action variables)
    8) click "Next"
    9) click "Finish"
    10) click "Ok"
    11) click "Ok"
    Hope this helps,
    Dan

  • I don't want firefox to reopen old windows when it restarts

    On the rare occasions when Firefox crashes and I restart it I often end up getting the same problem that led to the initial crash because Firefox tries to restore all the windows from the previous session. I looked in the preferences but couldn't find a way to change this behavior. I don't want it to try and re-open old windows when it restarts, just go to my home page and let me reopen windows manually. Can I set that somehow?

    I am not a computer programmer and don't remember whatever I may have learned in DOS classes... When I open Firefox it goes DIRECTLY to a page that crashes my computer: originally I had to TURN OFF my computer to get out of it. NOW Mozilla Firefox goes directy to that page again, does not ask if I WANT to restore that session.
    I am thinking I will just DELETE all of Firefox from the Program menu
    and then reload if I get around to it

  • I don't want Mail to be the default when I contact someone

    When a website contains a 'contact us' link, Mail automatically opens when I click the link. How do I change this? I have never been able to send & receive e-mail properly with Mail and it is useless for Mail to automatically open because I can't use it anyway.
    Thanks for any advice!

    Set Mail > Preferences > General > Default Email Reader to whatever mail client you want to be the default.
    Yes, unless your preferred mail client has a similar option to do the same, you’re supposed to use Mail in order to specify that you don’t want to use Mail, and in Mac OS X 10.4 you wouldn’t even be able to do that without setting up a mail account in Mail first.

  • Don´t want to play music videos automatically when playing a Single

    I´m using iTunes 11.
    Its very annoying that iTunes plays music videos automatically when I´m listening to a single I bought on iTunes Store which includes a music video.  I don´t have a problem with it when the video appears in my music library, but I don´t want to watch it when I only want to hear music and iTunes is minimized.
    I could create a playlist, but I don´t want to because for two tracks it´s worthless.
    So does anyone have a workaround for this issue?`
    Greets

    When in iTunes, click on file, then preferences. See the "general" tab. There is a drop down menu "When you insert a CD". What are your settings there ?

  • I don't want to write too much code is there a different way of doing this

    I am writing a precedure to check on the max test scores for different codes ('S01','S02'.S03') --there are more
    then I need to insert the table if the record with the best score does not exists for example for b.sortest_tesc_code = 'BSV', I am writing a cursor
    for each code (.sortest_tesc_code = 'S01') is there a way to do this different? so I cant do something like a.sortest_tesc_code in ('S01','S02'.S03') and store in a
    variable then insert, the problem is that you can have a student that have only one test other that have two etc..etc.. is not consistent, also If the b.sortest_tesc_code = 'BSV') is already in the table I don't do an insert I will have to do an update if the sortest_test_score is greater since the student can submit scores more than once... In another words check if the record exists( b.sortest_tesc_code = 'BSV') if is there compare with the new max score and if the new max score is greater then update.. If the score (by code) is not in the table insert
    Hope this is clear, this is what I have, I now it will work but it will be too much code..check for exists and not exists in two different precedures..
    Thank you
    CURSOR get_the_max_scores_S01_cur IS
                SELECT
                 sortest_pidm, a.sortest_test_score, a.sortest_tesc_code,
                 a.sortest_test_date,a.sortest_equiv_ind
                FROM
                saturn.spriden, saturn.sortest a, saturn.stvtesc
               WHERE 
               a.sortest_pidm = spriden_pidm
              AND stvtesc_code = a.sortest_tesc_code
              AND spriden_change_ind IS NULL
           -----and   a.sortest_tesc_code in ('S01','S02'.S03')
           AND a.sortest_tesc_code = 'S01'
           --and spriden_id = p_student_id  --
           ---for test purposes
           AND sortest_pidm = 133999 ----THE WILL BE A PARAMETER
           AND a.sortest_test_score =
                  (SELECT MAX (b.sortest_test_score)
                     FROM saturn.sortest b
                    WHERE a.sortest_tesc_code = b.sortest_tesc_code
                          AND a.sortest_pidm = b.sortest_pidm)
                                AND NOT EXISTS
                  (SELECT 1   FROM    saturn.sortest b
                  WHERE    A.sortest_tesc_code = b.sortest_tesc_code
                          AND a.sortest_pidm = b.sortest_pidm     
                          and   b.sortest_tesc_code = 'BSV');
         BEGIN
                     UTL_FILE.fclose_all;
                     v_file_handle := UTL_FILE.fopen (v_out_path, v_out_file, 'a');
                    UTL_FILE.put_line (v_file_handle,
                          CHR (10) || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH:MI:SS'));
                   UTL_FILE.put_line (v_file_handle, 'sortest_best_sct_scorest');
                   --check for an open cursor before opening
                   IF get_the_max_scores_S01_cur%ISOPEN
                       THEN
                        CLOSE get_the_max_scores_S01_cur;
                   END IF;
                OPEN get_the_max_scores_S01_cur;
                 LOOP
                       FETCH get_the_max_scores_S01_cur
                       INTO v_pidm, v_tscore, v_testcode,
                               v_test_date, v_equiv_ind;
                       EXIT WHEN get_the_max_scores_S01_cur%NOTFOUND;
                   IF  get_the_max_scores_S01_cur%FOUND 
                    THEN
                       INSERT INTO saturn.sortest
                       (sortest_pidm,sortest_tesc_code,sortest_test_date,sortest_test_score,
                        sortest_activity_date,sortest_equiv_ind,sortest_user_id,sortest_data_origin)
                        VALUES
                        v_pidm,
                       'BSV',
                        v_test_date,
                         v_tscore,
                         sysdate, 
                        v_equiv_ind,
                        p_user,
                        'best_test_scores process'
                   END IF;    
                   END LOOP;
                   COMMIT;
                   ---Initialize variables
                    v_pidm := NULL;
                    v_test_date := NULL; 
                    v_tscore  := NULL; 
                    v_equiv_ind :=  NULL;
                    v_testcode  :=  NULL;
                 CLOSE get_the_max_scores_S01_cur;
    ----then another do the same for S02...S03

    Thank you, here is the code, I change the name of the tables, but it is the same concept.what I need is to extract the max score for each code (s01,s02,s03,s04)
    then insert a record with a different code in the same table
    BSM     Best Math SAT (S01)                              
    BSW     Best writing SAT (S04)     
    BSC     Best READING SAT (S03)     
    BSE     Best READING SAT (S02)     
    I need to be able to check if the BS codes are already in the table (BSM...BSC..) IF they are not do an insert and if they are do an update get the maximun score
    again (the students can submit more than one score form the same code and any date) and if the maximun is different(greater) of what is already in the database (with the BSM...BSC.. codes) do an update, IF NOT if is the same or less don't update...
    I need the PERSON table because I need to use the ID as a parameter they (user) can run the process for one ID or all the records in the table TEST
    Thank you, I hope is clear
    create table TEST
    TEST_PIDM                  NUMBER(8)            NOT NULL,
    TEST_TESC_CODE        VARCHAR2(4 CHAR)     NOT NULL,
    TEST_TEST_DATE        DATE                 NOT NULL,
    TEST_TEST_SCORE       VARCHAR2(5 CHAR)     NOT NULL,
    TEST_ACTIVITY_DATE    DATE                 NOT NULL,
    TEST_EQUIV_IND        VARCHAR2(1 CHAR)     NOT NULL
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'EB' ,TO_DATE( '01-JUN-2004', 'DD-MON-YYYY'),'710',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'M2' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'710',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S01' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'750',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S01' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'720',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S02' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'740',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S02' ,TO_DATE( '05-JUL-2005', 'DD-MON-YYYY'),'730',SYSDATE,'N'
    FROM DUAL ;
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S03' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'780',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S03' ,TO_DATE( '05-JUL-2005', 'DD-MON-YYYY'),'740',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S04' ,TO_DATE( '01-JUN-2005', 'DD-MON-YYYY'),'770',SYSDATE,'N'
    FROM DUAL; 
    INSERT INTO TEST
    ( TEST_PIDM, TEST_TESC_CODE,TEST_TEST_DATE, TEST_TEST_SCORE, TEST_ACTIVITY_DATE,TEST_EQUIV_IND)
    SELECT
    128019,'S04' ,TO_DATE( '05-JUL-2005', 'DD-MON-YYYY'),'740',SYSDATE,'N'
    FROM DUAL; 
    CREATE TABLE PERSON
      PERSON_PIDM                NUMBER(8)         NOT NULL,
      PERSON_ID                  VARCHAR2(9 CHAR)  NOT NULL
    INSERT INTO  PERSON
    ( PERSON_PIDM ,   PERSON_ID)
    SELECT
    128019,'003334556'
    FROM DUAL ;
    CREATE TABLE VALTSC
    VALTSC_CODE             VARCHAR2(4 CHAR)     NOT NULL,
      VALTSC_DESC             VARCHAR2(30 CHAR)
    INSERT INTO  VALTSC
    VALTSC_CODE,
      VALTSC_DESC 
    SELECT
    'S01' ,
    'XXS01'
    FROM DUAL; 
      INSERT INTO  VALTSC
    VALTSC_CODE,
      VALTSC_DESC 
    SELECT
    'S02' ,
    'XXS02'
    FROM DUAL 
      INSERT INTO  VALTSC
    VALTSC_CODE,
      VALTSC_DESC 
    SELECT
    'S03' ,
    'XXS03'
    FROM DUAL; 
    INSERT INTO  VALTSC
    VALTSC_CODE,
      VALTSC_DESC 
    SELECT
    'S04' ,
    'XXS04'
    FROM DUAL; 

  • IPhone 3S was used with Bell, then unlocked to use with Rogers. Now I want to use it as iPod (Don't want to activate as phone),but when connecting to iTunes I'm getting message:  There is no SIM card, disconnect and insert new SIM card. Help?

    I have an old iPhone 3S, that was used with Bell. My friend lost her phone and I lend her this one, which she unlock to use with Rogers. I got it back and want to use as an iPod not the phone, but when I connected to iTunes I am getting this message: "There is no SIM card installed in the iPhone you are attempting to activate. Please diconnect and insert a SIM card".
    I went to Bell and Rogers where we tried inserting active cards but message never changed.
    On the phone itself I am able to get wifi but finish with "Your phone could not be activated because the activation server is temporary anavailable."
    I run diagnostic from iTunes:everything is working properly, only message out of normal is "iTunes is not running in safe mode"
    How can I sinc this phone with iTunes, so I can use it to lisen to music?
    Any help will be apriacieted

    I can not get to iPhone screen, so no way to get to Settings. That is the problem. When I connect phone to iTunes I get screen asking to insert SIN card. On the phone I'm getting Cinfigure screen asking Launguage , Country or Region, Wi-Fi, ( I can connect to my home wi-fi), and last screen "Activating your iPhone". After two minutes of waiting IM getting message: Your iPhone could not be activated because the activation server in temporary unavailable. try connecting to iTunes or try later or contat apple.com/support.
    Like I mention, I went to Bell as well Rogers store and tried to insert active SIM card with no results.
    Yes, my friend unlock the phone to use with Rogers but I don't know where

  • When I print from the web, the print is blue ink, which I don't want and can't read. When I print from Word, it is black ink. What is the problem?

    If I print an article downloaded from the web, it prints in blue ink, which is almost not readable. If I download it to Word or print a document stand alone in Word, it prints in black ink, which is what I want. I didn't have this problem before I upgraded to the new Firefox. Please help.
    Thanks
    Lee Gregg

    I should also point out that when I connect my iPhone, it DOESN'T appear as a connected drive on the desktop. Not sure how this can be so, since the iPhone also has a drive and also functions as an iPod if I want it to. I must have changed some setting to achieve this non-appearance, but don't remember what I must have done.
    What's the secret?

  • Execute code when IE Browser closes

    Help!  I'm trying to find a way to run a SQL statement when a user closes a IE window (X's out).  I've found information on the onBeforeUnload event but I've been unsucessful at getting it to run.
    Does anyone have another suggestion?  Is it even possible to execute code upon closing a window?
    Thanks!!!

    Thanks ilssac.  I figured this was the case based on my research but I thought I'd present it to the Forum just to be sure.
    Basically, I've been asked to limit the number of logins to a small Coldfusion application.  I've coded it so that I increment a counter in the DB and I decrement it when the user logs out properly (by clicking a logout link).  But if the user just closes the window then the decrement doesn't happen and this created problems.
    If you have any suggestions I would really appreciate it.
    Thanks for your time!!!!

Maybe you are looking for

  • Send Email Report with Publisher? and  Job Manager...

    Hi, i have a great Doubt, i try to send Email with a report, first i try to send with Publisher, this is all configurations. Delivery Configuration !http://lh3.ggpht.com/_V2lpPpulbm0/Slwm-4TLiJI/AAAAAAAACag/xZ5w57zkRnM/s800/BI%20Publisher.PNG! Email

  • I just discovered I have over 700 emails in the Bulk Mailer folder. Is there a way to delete them all in one step?

    I just discovered I have over 700 emails in the Bulk Mail folder. Is there a way to delete them in one step, rather than individually?

  • Using WHERE NOT EXISTS for a Fact Table Load

    I'm trying to set up a fact table load using T SQL, and I need to use WHERE NOT EXISTS. All of the fields from the fact table are listed in the WHERE NOT EXISTS clause. What I expect is that if the value of any one of the fields is different, that th

  • Trouble compiling a library

    Hi folks, I'm experiencing a trouble using forms & reports on two different platforms: Win XP Prof. SP2 for development and SuSe Ent. 9 Linux for deployment. I've inherited from another person an application with some forms, some reports and two libr

  • Partioning cube Measures dynamically

    Hi Team, We need to partition our cube dynamically based on year and period(ex 201306). So when there is a data load/update is happening in the fact only the particular partition is processed and not all. Dynamic partition I mean, when there is a loa