0

My problem is that i don't know how to render current time in jsf every second. I have a bean:

@Schedule(second="*",minute="*",hour="*")
public void showTime() {
    date = new Date();
}

public Date getDate() {
    return date;
}

public void setDate(Date date) {
    this.date = date;
}

And i can only render current time by clicking button. I would like to render it every second without clicking.

Maybe there is better way to do it instead of using @Schedule and java.util.Date. Thanks in advance.

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
Trance
  • 1
  • 2
    wouldn't it be better to use JS function on the client side for that? – kolakao May 12 '16 at 14:32
  • @BalusC the linked duplicate is misleading because of the comment above me. Trance I don't think you want to change the time via ajax. – Ced May 12 '16 at 17:40

0 Answers0