Here is the servlet Version:
out.println(time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds());
Then just add the following code to your Javascript on the JSP:
function init(){
window.setInterval("ajaxFunction()",1000);
}
And call it here:
This will run a function every 1000ms.