/** * Matches the given request against all configures sites and returns * the matching site, or the default site if no sites matches.<p> * * @param req the request to match * * @return the matching site, or the default site if no sites matches */ public CmsSite matchRequest(HttpServletRequest req) { CmsSiteMatcher matcher = getRequestMatcher(req); if (matcher.getTimeOffset() != 0) { HttpSession session = req.getSession(); if (session != null) { session.setAttribute(CmsContextInfo.ATTRIBUTE_REQUEST_TIME, new Long(System.currentTimeMillis() + matcher.getTimeOffset())); } } CmsSite site = matchSite(matcher); if (LOG.isDebugEnabled()) { String requestServer = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort(); LOG.debug(Messages.get().getBundle().key( Messages.LOG_MATCHING_REQUEST_TO_SITE_2, requestServer, site.toString())); } return site; }
/** * Matches the given request against all configures sites and returns * the matching site, or the default site if no sites matches.<p> * * @param req the request to match * * @return the matching site, or the default site if no sites matches */ public CmsSite matchRequest(HttpServletRequest req) { CmsSiteMatcher matcher = getRequestMatcher(req); if (matcher.getTimeOffset() != 0) { HttpSession session = req.getSession(); if (session != null) { session.setAttribute( CmsContextInfo.ATTRIBUTE_REQUEST_TIME, new Long(System.currentTimeMillis() + matcher.getTimeOffset())); } } CmsSite site = matchSite(matcher); if (LOG.isDebugEnabled()) { String requestServer = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort(); LOG.debug( Messages.get().getBundle().key( Messages.LOG_MATCHING_REQUEST_TO_SITE_2, requestServer, site.toString())); } return site; }
Element aliasElement = siteElement.addElement(N_ALIAS); aliasElement.addAttribute(A_SERVER, matcher.getUrl()); if (matcher.getTimeOffset() != 0) { aliasElement.addAttribute(A_OFFSET, "" + matcher.getTimeOffset());
Element aliasElement = siteElement.addElement(N_ALIAS); aliasElement.addAttribute(A_SERVER, matcher.getUrl()); if (matcher.getTimeOffset() != 0) { aliasElement.addAttribute(A_OFFSET, "" + matcher.getTimeOffset());
time += OpenCms.getSiteManager().getSiteForSiteRoot(dbc.getRequestContext().getSiteRoot()).getSiteMatcher().getTimeOffset();
&& (OpenCms.getSiteManager().getSiteForSiteRoot(dbc.getRequestContext().getSiteRoot()) != null)) { time += OpenCms.getSiteManager().getSiteForSiteRoot( dbc.getRequestContext().getSiteRoot()).getSiteMatcher().getTimeOffset();