public ExternalContext.Session getSession(boolean create) {
   if (session == null) {
     PortletSession nativeSession = portletRequest.getPortletSession(create);
     if (nativeSession != null) session = new Session(nativeSession);
   }
   return session;
 }
Example #2
0
 /**
  * Get SessionBean.
  *
  * @param request PortletRequest
  * @return Vlado2PortletSessionBean
  */
 private static Vlado2PortletSessionBean getSessionBean(PortletRequest request) {
   PortletSession session = request.getPortletSession();
   if (session == null) return null;
   Vlado2PortletSessionBean sessionBean =
       (Vlado2PortletSessionBean) session.getAttribute(SESSION_BEAN);
   if (sessionBean == null) {
     sessionBean = new Vlado2PortletSessionBean();
     session.setAttribute(SESSION_BEAN, sessionBean);
   }
   return sessionBean;
 }