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); }
public boolean isMobile(HttpServletRequest request) { SitePreference sitePreference = SitePreferenceUtils.getCurrentSitePreference(request); return sitePreference.isMobile(); }