Пример #1
0
 public static void setUserSession(HttpServletRequest request, String propertyName, Object obj) {
   UserSession gus = (UserSession) WebUtils.getSessionAttribute(request, Constant.SESS_USER);
   if (propertyName.equals(PROPERTY_USER)) gus.setUser((User) obj);
   else if (propertyName.equals(PROPERTY_LOGIN)) gus.setLogin((Integer) obj);
   else if (propertyName.equals(PROPERTY_BOX_LIST)) gus.setBoxList((List) obj);
   else if (propertyName.equals(PROPERTY_SEARCH)) gus.setSearchKey((String) obj);
 }
Пример #2
0
 public static void setUserSession(
     HttpServletRequest request, User loginUser, UserService userService) {
   UserSession gus = new UserSession();
   gus.setUser(loginUser);
   WebUtils.setSessionAttribute(request, Constant.SESS_USER, gus);
 }