In my web app, date & time of a user\'s certain activity is stored(in database) as a timestamp Long
which on being displayed back to user needs to be conver
Not sure if JSF provides a built-in functionality, but you could use java.sql.Date
's constructor to convert to a date object: http://download.oracle.com/javase/1.5.0/docs/api/java/sql/Date.html#Date(long)
Then you should be able to use higher level features provided by Java SE, Java EE to display and format the extracted date. You could instantiate a java.util.Calendar
and explicitly set the time: http://download.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html#setTime(java.util.Date)
EDIT: The JSF components should not take care of the conversion. Your data access layer (persistence layer) should take care of this. In other words, your JSF components should not handle the long
typed attributes but only a Date
or Calendar
typed attributes.