/** * Return the context path at which the web application is deployed. */ public String getContextPath() { String ctxPath = null; if (_wbd != null) { ctxPath = _wbd.getContextRoot().trim(); // Don't prefix a / if this web module is the default one // i.e. has an empty context-root if ((ctxPath.length() > 0) && !ctxPath.startsWith("/")) { ctxPath = "/" + ctxPath; } else if (ctxPath.equals("/")) { ctxPath = ""; } } return ctxPath; }
/** * This must be invoked after virtualServer is set. */ private String getAppContextID(final ServletContext servletContext) { if (!servletContext.getVirtualServerName().equals( this.virtualServer.getName())) { _logger.log(Level.WARNING, "Virtual server name from ServletContext: {0} differs from name from virtual.getName(): {1}", new Object[]{servletContext.getVirtualServerName(), virtualServer.getName()}); } if (!servletContext.getContextPath().equals(webDesc.getContextRoot())) { _logger.log(Level.WARNING, "Context path from ServletContext: {0} differs from path from bundle: {1}", new Object[]{servletContext.getContextPath(), webDesc.getContextRoot()}); } return servletContext.getVirtualServerName() + " " + servletContext.getContextPath(); }
/** * Suspends this application on all virtual servers. */ public boolean suspend() { return container.suspendWebModule( wmInfo.getDescriptor().getContextRoot(), "null", null); }
public Node writeDescriptor(Node parent, WebServiceEndpoint descriptor) { String ctxtPath; String serviceUri; String endpointAddressUri = descriptor.getEndpointAddressUri(); if (descriptor.implementedByEjbComponent()) { ctxtPath = endpointAddressUri.substring(0, endpointAddressUri.lastIndexOf("/") - 1); serviceUri = endpointAddressUri.substring(endpointAddressUri.lastIndexOf("/")); } else { //for servlet endpoint, use web application context root ctxtPath = descriptor.getWebComponentImpl().getWebBundleDescriptor().getContextRoot(); serviceUri = endpointAddressUri; } Document doc = getOwnerDocument(parent); Element serviceEndpointAddress = doc.createElement(WLWebServicesTagNames.SERVICE_ENDPOINT_ADDRESS); Element ctxtPathEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_CONTEXTPATH); ctxtPathEl.appendChild(doc.createTextNode(ctxtPath)); serviceEndpointAddress.appendChild(ctxtPathEl); Element serviceuriEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_SERVICEURI); serviceuriEl.appendChild(doc.createTextNode(serviceUri)); serviceEndpointAddress.appendChild(serviceuriEl); parent.appendChild(serviceEndpointAddress); return serviceEndpointAddress; }
public Node writeDescriptor(Node parent, WebServiceEndpoint descriptor) { String ctxtPath; String serviceUri; String endpointAddressUri = descriptor.getEndpointAddressUri(); if (descriptor.implementedByEjbComponent()) { ctxtPath = endpointAddressUri.substring(0, endpointAddressUri.lastIndexOf("/") - 1); serviceUri = endpointAddressUri.substring(endpointAddressUri.lastIndexOf("/")); } else { //for servlet endpoint, use web application context root ctxtPath = descriptor.getWebComponentImpl().getWebBundleDescriptor().getContextRoot(); serviceUri = endpointAddressUri; } Document doc = getOwnerDocument(parent); Element serviceEndpointAddress = doc.createElement(WLWebServicesTagNames.SERVICE_ENDPOINT_ADDRESS); Element ctxtPathEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_CONTEXTPATH); ctxtPathEl.appendChild(doc.createTextNode(ctxtPath)); serviceEndpointAddress.appendChild(ctxtPathEl); Element serviceuriEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_SERVICEURI); serviceuriEl.appendChild(doc.createTextNode(serviceUri)); serviceEndpointAddress.appendChild(serviceuriEl); parent.appendChild(serviceEndpointAddress); return serviceEndpointAddress; }
WebBundleDescriptor webBundle = webComponentImpl.getWebBundleDescriptor(); String contextRoot = webBundle.getContextRoot(); if( contextRoot.startsWith("/") ) { contextRoot = contextRoot.substring(1);
WebBundleDescriptor webBundle = webComponentImpl.getWebBundleDescriptor(); String contextRoot = webBundle.getContextRoot(); if( contextRoot.startsWith("/") ) { contextRoot = contextRoot.substring(1);
public void printCommon(StringBuffer toStringBuffer) { super.print(toStringBuffer); toStringBuffer.append("\n context root ").append(getContextRoot()); if (sessionConfig != null) { toStringBuffer.append(sessionConfig);
void configureWebServices(WebBundleDescriptor wbd) { if (wbd.hasWebServices()) { setHasWebServices(true); // creates the list of endpoint addresses String[] endpointAddresses; WebServicesDescriptor webService = wbd.getWebServices(); Vector<String> endpointList = new Vector<String>(); for(WebServiceEndpoint wse : webService.getEndpoints()) { if(wbd.getContextRoot() != null) { endpointList.add(wbd.getContextRoot() + "/" + wse.getEndpointAddressUri()); } else { endpointList.add(wse.getEndpointAddressUri()); } } endpointAddresses = new String[endpointList.size()]; endpointList.copyInto(endpointAddresses); setEndpointAddresses(endpointAddresses); } else { setHasWebServices(false); } }
@Override public void contextInitialized(ServletContextEvent sce) { WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance(); ComponentEnvManager compEnvManager = wscImpl.getComponentEnvManager(); JndiNameEnvironment jndiNameEnv = compEnvManager.getCurrentJndiNameEnvironment(); WebBundleDescriptor webBundle = null; if (jndiNameEnv != null && jndiNameEnv instanceof WebBundleDescriptor) { webBundle = ((WebBundleDescriptor) jndiNameEnv); } else { throw new WebServiceException("Cannot intialize the JAXWSServlet for " + jndiNameEnv); } contextRoot = webBundle.getContextRoot(); WebServicesDescriptor webServices = webBundle.getWebServices(); try { for (WebServiceEndpoint endpoint : webServices.getEndpoints()) { registerEndpoint(endpoint, sce.getServletContext()); } } catch (Throwable t) { logger.log(Level.WARNING, "Deployment failed", t);//TODO Fix Rama sce.getServletContext().removeAttribute("ADAPTER_LIST"); throw new RuntimeException("Servlet web service endpoint '" + "' failure", t); } }
String contextRoot = (cr == null)?webBundle.getContextRoot():cr;
public boolean stop(ApplicationContext stopContext) { if (stopContext instanceof DeploymentContext) { DeploymentContext deployContext = (DeploymentContext)stopContext; Properties props = null; boolean keepSessions = isKeepState(deployContext, false); if (keepSessions) { props = new Properties(); } container.unloadWebModule(getDescriptor().getContextRoot(), null, wmInfo.getVirtualServers(), props); if (keepSessions) { Properties actionReportProps = getActionReportProperties(deployContext); // should not be null here if (actionReportProps != null) { actionReportProps.putAll(props); } } } stopCoherenceWeb(); return true; }
contextRoot = webBundle.getContextRoot(); WebComponentDescriptor webComponent = webBundle.getWebComponentByCanonicalName(servletName);
logger.log(Level.INFO, "webApplication.loadingApplication", new Object[] {wmInfo.getDescriptor().getName(), wmInfo.getDescriptor().getContextRoot()});
String contextRoot = (cr == null)?webBundle.getContextRoot():cr;
String contextRoot = params.contextroot; if(contextRoot==null) { contextRoot = wbd.getContextRoot(); if("".equals(contextRoot)) contextRoot = null;
/** * Entry point from the framework into the command execution * @param context context for the command. */ public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); ActionReport.MessagePart part = report.getTopMessagePart(); ApplicationInfo appInfo = appRegistry.get(appname); if (appInfo != null) { Application app = appInfo.getMetaData(Application.class); if (app != null) { BundleDescriptor bundleDesc = app.getModuleByUri(modulename); if (bundleDesc != null && bundleDesc instanceof WebBundleDescriptor) { String contextRoot = ((WebBundleDescriptor)bundleDesc).getContextRoot(); part.addProperty(DeploymentProperties.CONTEXT_ROOT, contextRoot); part.setMessage(contextRoot); } } } } }
webEnv.getContextRoot(); _logger.finer("ComponentEnvManagerImpl: " + "converting EJB to web bundle id " + id); WebBundleDescriptor webEnv = (WebBundleDescriptor) env; id = webEnv.getApplication().getName() + ID_SEPARATOR + webEnv.getContextRoot(); } else if (env instanceof ApplicationClientDescriptor) { ApplicationClientDescriptor appEnv =
+ webEnv.getContextRoot(); if (deplLogger.isLoggable(Level.FINER)) { deplLogger.log(Level.FINER, CONVERT_EJB_TO_WEB_ID, id); WebBundleDescriptor webEnv = (WebBundleDescriptor) env; id = webEnv.getApplication().getName() + ID_SEPARATOR + webEnv.getContextRoot(); } else if (env instanceof ApplicationClientDescriptor) { ApplicationClientDescriptor appEnv = (ApplicationClientDescriptor) env;
appendTextChild(root, RuntimeTagNames.CONTEXT_ROOT, bundleDescriptor.getContextRoot());