A timer in Java

  • פותח הנושא mz70
  • פורסם בתאריך

mz70

New member
A timer in Java

Hi all, I am building a program for taking tests using servlets and JSP. I need to create a timer that will stay on during the test. The problem is that if I use JavaScrips for this, the timer refreshes every time I click a button on the page. I know that I can use an Applet but the applet/servlet comunication is not that simple. Is there another way to do that? Thanks to all that can help.
 

philips

New member
hmmm...

welp....several ideas: 1st. the use of servlet-applet is not a bad idea coz it will decrease the load on the server and shift some of it to the client... it is rather easy to combine them both , and there are tons of tutorials examples if u cant find by yourself in google ,ask and I will post... U can also look for a file applet2servlet (or something like that) which kinds helps build what u want/understand whats going on.. 2nd... u can tweak with the html refresh rate or use JS´s timer.. gotta go....try to be more specific and i will try to help
 

mz70

New member
thanks but do you have

any examples? or links, I didn´t find anything usefull.
 

philips

New member
hmmm.

http://www.j-nine.com/pubs/applet2servlet/ http://developer.netscape.com/viewsource/fields_servlet/fields_servlet.html http://www.cloudscape.com/support/demo/programs/servlet/appletclient/example.html http://www.devx.com/upload/free/features/javapro/1999/05may99/lo0599/lo0599.asp after reconsidering I decided to update my applet-servlet tip from above. use it only for when u need a really "big"-massive client side application.. In all other cases, a good use of JS along with a servlet or Server side JS , will be the better choice for INTERNET deployment... (for intranet it doesnt matter) basically I didnt understand ur problem , so I cant offer a Js solutions...
 

mz70

New member
first of all thanks fo the attantio

I will try to explain more: I have a servlet that gets the question and the 4 posible answers from a database. this servlet as you know is the same for all the questions. I need to show a timer for the person who is taking the test that will not refresh every time the person clicks the next or prev button, what will bacikly calls the same servlet with other information. I will try to send the servlet as html.
 
למעלה