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);
 }
 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;
 }
  protected String doHandleGet(UserSession ctx, String link, Map args) {
    PhotoFilter filter = ctx.getPhotoFilter();

    String un = ctx.getAsString(args, PhotoFilter.USER_NAME);
    if (StringUtil.isLegalUserName(un)) {
      filter.setUserName(un);
    }

    String tags = ctx.getAsString(args, PhotoFilter.TAGS);
    if (StringUtil.isLegalTagsString(tags)) {
      filter.setTags(new Tags(tags));
    }

    return PartUtil.SHOW_PHOTO_PAGE_NAME;
  }
 public static void setUserSession(
     HttpServletRequest request, User loginUser, UserService userService) {
   UserSession gus = new UserSession();
   gus.setUser(loginUser);
   WebUtils.setSessionAttribute(request, Constant.SESS_USER, gus);
 }
 public static User getSessionUser(HttpSession session) {
   UserSession gus = (UserSession) session.getAttribute(Constant.SESS_USER);
   return gus.getUser();
 }
 protected void makeWebPageBody(UserSession ctx, WebPart page) {
   page.addString("noteHeading", ctx.cfg().getInformation());
   String msg1 = ctx.cfg().getContinueWithShowPhoto();
   page.addString("note", msg1);
 }