you mean while someone is looking at the page and they dont click anything they will see it change? If this is what you mean, then write a Javascript that does this, not that complicated.
If you mean if someone clicks they see the right time, but then in their browser, it stays like that. And if someone else clicks, they see the current time which might be different that the first user. Then just write a scriptlet with a SimpleDateFormatter that prints out the current date... (or this could be an EL, or custom tag, or whatever)
Chris
You can achieve this using AJAX. Since using ajax call you can output a string/jsp/xml, in your case make it as a jsp and in your destination page (parent jsp), have a DIV tag and then dynamically load the output jsp into this DIV tag. Using javascript setTimeOut, you can trigger this ajax call for every minute. I would do only this way.
hello friend ru looking at date and time @ client side frm the server side if it is all about the client side date i don't think there is use of AJAX triggers and rendering the view by modifying the dom...
here is an example for you..
<%@ page language="java"%>
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
function startclock()
{
var thetime=new Date();
var nhours=thetime.getHours();
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var nday=thetime.getDay();
var nmonth=thetime.getMonth();
var ntoday=thetime.getDate();
var nyear=thetime.getYear();
var AorP=" ";
if (nhours>=12)
AorP="P.M.";
else
AorP="A.M.";
if (nhours>=13)
nhours-=12;
if (nhours==0)
nhours=12;
if (nsecn<10)
nsecn="0"+nsecn;
if (nmins<10)
nmins="0"+nmins;
if (nday==0)
nday="Sunday";
if (nday==1)
nday="Monday";
if (nday==2)
nday="Tuesday";
if (nday==3)
nday="Wednesday";
if (nday==4)
nday="Thursday";
if (nday==5)
nday="Friday";
if (nday==6)
nday="Saturday";
nmonth+=1;
if (nyear<=99)
nyear= "19"+nyear;
if ((nyear>99) && (nyear<2000))
nyear+=1900;
this.document.getElementById("clockspot").innerHTML = "<b>"+nhours+": "+nmins+": "+nsecn+" "+AorP+" "+nday+", "+nmonth+"/"+ntoday+"/"+nyear+"</b>";
setTimeout('startclock()',1000);
}
</SCRIPT>
</HEAD>
<BODY>
<div id="clockspot"></div>
<SCRIPT language="JavaScript">
startclock();
</SCRIPT>
</BODY>
</HTML>
hope this might help :)
REGARDS,
RaHuL