private WebBeansContext getWebBeansContext(final ContextInfo contextInfo) { final AppContext appContext = getContainerSystem().getAppContext(contextInfo.appInfo.appId); if (appContext == null) { return null; } WebBeansContext webBeansContext = appContext.getWebBeansContext(); if (webBeansContext == null) { return null; } for (final WebContext web : appContext.getWebContexts()) { final String stdName = removeFirstSlashAndWar(contextInfo.standardContext.getName()); if (stdName == null) { continue; } final String name = removeFirstSlashAndWar(web.getContextRoot()); if (stdName.equals(name)) { webBeansContext = web.getWebbeansContext(); if (Contexts.getHostname(contextInfo.standardContext).equals(web.getHost())) { break; } // else loop hoping to find a better matching } } if (webBeansContext == null) { webBeansContext = appContext.getWebBeansContext(); } return webBeansContext; }
DeploymentLoader.unpack(docBaseFile); if (standardContext.getPath().endsWith(".war")) { standardContext.setPath(removeFirstSlashAndWar("/" + standardContext.getPath())); standardContext.setName(standardContext.getPath()); webApp.contextRoot = standardContext.getPath();