• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Display time in JSP without refreshing page

 
Deepak Lohar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am trying to achieve the following funtionality in my JSP page:
=========================================================
I want the time to be in number of seconds, like when the seconds is incrementing
as 1, 2 , 3 .....58,59,60...after 60 i want it continue as 61, 62 and so on.
I am able to acheive this through JavaScript , but i simply dont want to use JavaScript.
Secondly I want to display this time in Seconds on the JSP page without refreshing the page,
i mean i dont want to call the refresh on the page but the variable holding the time in seconds
should be updated and should increment by a second and should be diplayed on the page,
for example 1, 2 , 3......59, 60 , 61 and so on.
Even this i could achieve through JavaScript , again i dont want to use JavaScript.
I want to achieve the above functionality by Pure JSP code.
--------------------------------------
Actually i am creating a loop based on number of seconds, and after 12 seconds there is a movie clip to be palyed , then after 15 seconds there is a gif file to be loaded for another 12 seconds and like wise things come and go based on certain intervals of specified number of seconds .
its a simple one like
variable x of type long, is holding the value in seconds
if (x>=01 && x<=15){
// movie clip for 15 sec
}
else if (x>=16 && x<=27){
// gif file for 12 sec
}
else if ( x >=28 && x<=42){
// flash fiel for 15 sec
}
..
...
else if ( x<60 && x<=75){
// movie clip for 15 sec
}
so on and so forth till x reaches 300 seconds
-------------------------------------
any immediate reponse will be of great help
cheers
Deepak
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am able to acheive this through JavaScript , but i simply dont want to use JavaScript.
Secondly I want to display this time in Seconds on the JSP page without refreshing the page,

Well, you're going to have to pick one or the other. To perform this functionality completely on the client side, you'll need Javascript. To perform it on the server side, you need a server hit.
Now, if it's just the master page you want to avoid refreshing, you can create an iframe to show the timestamp and refresh only it.
But other than that, it's Javascript, or an applet, or an ActiveX control, or something along those lines, but you can't do this in "pure JSP" without a server hit each time to update the count.
hth,
bear
 
Deepak Lohar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody throw some more light on this topic.
thx
Deepak
[ June 09, 2003: Message edited by: Deepak Lohar ]
 
Deepak Lohar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can Anybody throe some light on how to achieve the above fucntionlaity.
Deepak
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, which approach do you want to pursue? And given that this is not a JSP question at all, this would be better discussed in the HTML/Javascript forum.
hth,
bear
[ June 09, 2003: Message edited by: Bear Bibeault ]
 
sunitha reghu
Ranch Hand
Posts: 937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak,
Better use Flash and Flash script. Then it will be very easy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic