Example #1
0
 public static Object getUserSession(HttpServletRequest request, String propertyName) {
   UserSession gus = (UserSession) WebUtils.getSessionAttribute(request, Constant.SESS_USER);
   if (gus != null && propertyName.equals(PROPERTY_USER)) return gus.getUser();
   else if (gus != null && propertyName.equals(PROPERTY_LOGIN)) return gus.getLogin();
   else if (gus != null && propertyName.equals(PROPERTY_BOX_LIST)) return gus.getBoxList();
   else if (gus != null && propertyName.equals(PROPERTY_SEARCH)) return gus.getSearchKey();
   return null;
 }
Example #2
0
 public static User getSessionUser(HttpSession session) {
   UserSession gus = (UserSession) session.getAttribute(Constant.SESS_USER);
   return gus.getUser();
 }