protected String loginPageRedirection() {
   boolean isAnonymous = WorkflowUtil.isCurrentUserAnonymous();
   boolean hasCurrentPage = userview.getCurrent() != null;
   if ((!isAuthorized || !hasCurrentPage) && isAnonymous) {
     return "redirect:"
         + getLoginLink()
         + (request.getQueryString() == null
             ? ""
             : ("?" + StringUtil.decodeURL(request.getQueryString())));
   }
   return null;
 }
  protected String loginRedirection() {
    boolean isAnonymous = WorkflowUtil.isCurrentUserAnonymous();
    if (!isAnonymous) {
      String url = getBaseLink();
      String menuId = userview.getParamString("menuId");
      // check current redirect url is exist, else redirect to home
      boolean isExist = false;
      if (menuId != null && !menuId.isEmpty()) {
        for (UserviewCategory c : userview.getCategories()) {
          for (UserviewMenu m : c.getMenus()) {
            if (menuId.equals(m.getPropertyString("id"))
                || menuId.equals(m.getPropertyString("customId"))) {
              isExist = true;
              break;
            }
          }
          if (isExist) {
            break;
          }
        }
      }
      if (isExist) {
        if (!userview.getParamString("menuId").isEmpty()) {
          url += menuId;
        }
        if (request.getQueryString() != null) {
          url += "?" + request.getQueryString();
        }
      } else {
        url += userview.getProperty("homeMenuId");
      }

      return "redirect:" + url;
    }
    return null;
  }