protected String mobileViewRedirection() {
    boolean mobileAgent = (!MobileUtil.isMobileDisabled() && MobileUtil.isMobileUserAgent(request));
    boolean disableMobileView =
        "true".equalsIgnoreCase(userview.getSetting().getPropertyString("mobileViewDisabled"));
    boolean desktopCookie = false;
    Cookie[] cookies = request.getCookies();
    if (cookies != null) {
      for (Cookie cookie : cookies) {
        if ("desktopSite".equals(cookie.getName())) {
          if ("true".equalsIgnoreCase(cookie.getValue())) {
            desktopCookie = true;
          }
          break;
        }
      }
    }

    if (mobileAgent && !disableMobileView && !desktopCookie) {
      String url =
          "/web/mobile/"
              + userview.getParamString("appId")
              + "/"
              + userview.getPropertyString("id")
              + "/"
              + userview.getParamString("key")
              + "/";
      if (!userview.getParamString("menuId").isEmpty()) {
        url += userview.getParamString("menuId");
      }
      return "redirect:" + url;
    }
    return null;
  }