Class UserSession

    • Field Detail

      • log

        protected static final Log log
      • request

        protected javax.servlet.http.HttpServletRequest request
    • Constructor Detail

      • UserSession

        protected UserSession​(javax.servlet.http.HttpServletRequest request)
    • Method Detail

      • getCurrentSession

        public static UserSession getCurrentSession​(javax.servlet.http.HttpServletRequest request)
      • getPrincipal

        public Principal getPrincipal()
      • addRequestCleanupHandler

        public static void addRequestCleanupHandler​(javax.servlet.http.HttpServletRequest request,
                                                    RequestCleanupHandler handler)
        Register a cleanup handler that will be invoked when HTTP request terminate. This method is not thread safe.
      • findComponent

        public <T extends Component> T findComponent​(Class<T> type,
                                                     String name)
        Finds an existing component.

        The component state will not be modified before being returned as in getComponent(Class, String).

        If the component was not found in that session, returns null.

      • getComponent

        public <T extends Component> T getComponent​(Class<T> type,
                                                    String name)
                                             throws SessionException
        Gets a component given its class and an optional name.

        If the component was not yet created in this session, it will be created and registered against the session.

        Throws:
        SessionException