Exemplo n.º 1
0
  public void resolveSiteType(
      ModelAndView modelAndView, String viewName, HttpServletRequest request) {
    SitePreference sitePreference = SitePreferenceUtils.getCurrentSitePreference(request);
    StringBuffer resultViewName = new StringBuffer(viewName);

    if (sitePreference.isMobile()) {
      resultViewName = resultViewName.insert(0, MOBILE_SITE_PREFIX);
    }

    modelAndView.setViewName(resultViewName.toString());

    String url = UrlHelper.constructCurrentPageUrl(request);
    request.setAttribute("currentPageUrl", url);
  }
Exemplo n.º 2
0
  public boolean isMobile(HttpServletRequest request) {
    SitePreference sitePreference = SitePreferenceUtils.getCurrentSitePreference(request);

    return sitePreference.isMobile();
  }