marți, 14 aprilie 2015

[OmniFaces utilities (2.0)] Get the time when the HTTP session was created, measured in epoch time


[OmniFaces utilities] The getSessionCreationTime() method returns the time when the HTTP session was created, measured in epoch time. This implicitly creates the session if one doesn't exist.

Method:
Usage:

import org.omnifaces.util.Faces;
...
long time = Faces.getSessionCreationTime();
Date dateTile = new Date(time); //e.g. Tue Apr 14 15:48:23 EEST 2015

Niciun comentariu:

Trimiteți un comentariu