@ SuppressWarnings ( "unchecked" ) public static < T > T getSessionAttribute ( final HttpSession session , final String key ) { if ( session != null ) { return ( T ) session . getAttribute ( key ) ; } return null ; }
Returns a session attribute as the type of object stored .