@Override public VirtualHost getVirtualHost() { return new PreviewDecoratedVirtualHost(delegatee.getVirtualHost()); }
/** * This is a hook into the HstServices component manager to look up in the {@link VirtualHosts} whether the contextPath should be in the * URL. Although this can be overridden per {@link VirtualHost} or {@link Mount}, this is the best we can do at this moment as we do * not have an {@link HstRequestContext} and also no {@link ResolvedMount} thus. * @param request * @return <code>true</code> when the global {@link VirtualHosts} is configured to have the contextPath in the URL */ protected boolean isContextPathInUrl(HttpServletRequest request) { if (loginSiteFromTemplateComposer(request)) { // site running in cms host always needs context path return true; } ResolvedVirtualHost host = (ResolvedVirtualHost) request.getAttribute(ContainerConstants.VIRTUALHOSTS_REQUEST_ATTR); if(host != null) { return host.getVirtualHost().isContextPathInUrl(); } return true; }
/** * @param resolvedSiteMapItem * @return the HstURLFactory */ public HstURLFactory getURLFactory(ResolvedSiteMapItem resolvedSiteMapItem) { HstURLFactory factory = resolvedSiteMapItem.getResolvedSiteMount().getResolvedVirtualHost().getVirtualHost().getVirtualHosts().getVirtualHostsManager().getUrlFactory(); return factory; } }
return; final String hostGroupNameForCmsHost = resolvedVirtualHost.getVirtualHost().getHostGroupName(); requestContext.setAttribute(HOST_GROUP_NAME_FOR_CMS_HOST, hostGroupNameForCmsHost); context.invokeNext();
if (resolvedVirtualHost.getVirtualHost().isContextPathInUrl()) { if (fullyQualifiedPrefix != null) { return fullyQualifiedPrefix + servletRequest.getContextPath() + pathInfo;
log.debug("{} matched to host '{}'", containerRequest, resolvedVirtualHost.getVirtualHost());