Well sure,

I don't quite understand what exactly you need for your output. It's just a simple getter for a bean... But anyway... To just put out the current time and date, create a bean like TimeBean.java

import java.util.Calendar;

... etc. blabla

public String getDate(){
    return Calendar.getInstance().getTime().toString();
}

In faces-config.xml you need to map your TimeBean.java to for example timeBean...

Then access the value in JSF like <t:outputText value="#{timeBean.getDate}" />


I didn't check/run the code snipplets, just wrote them down in this e-mail, so perhaps you need to correct some method names, but I think it's fine this way and working.

Give it a try.

Andreas



Legolas Woodland wrote:
Andreas Zeller - zit-systems wrote:
Hey Legolas,

Timestamp? java.util.Calendar.getInstance().getTime() will give you the
current time and date... Does that help you?

Andreas

Legolas Woodland wrote:

  
Hi
Thank you for reading my post
How i can show current timestamp in jsf ?

thanks


    


  
Hi
Thank you for the reply.
I mean how i can print it in a jsf page.
imagine that i have a jsf page and i want to show current timestamp , what should i do ,can you give me a sample ?


Reply via email to