public void initialize(HttpServlet servlet) { IApplicationSpecification spec = null; Resource specResource = findApplicationSpecification(servlet); if (specResource == null) { _log.warn(ImplMessages.noApplicationSpecification(servlet)); spec = constructStandinSpecification(servlet); } else spec = _parser.parseApplicationSpecification(specResource); _globals.storeActivator(new HttpServletWebActivator(servlet)); _globals.storeSpecification(spec); }
private Resource findApplicationSpecification(HttpServlet servlet) { String path = servlet.getInitParameter(APP_SPEC_PATH_PARAM); if (path != null) return _classpathResourceFactory.newResource(path); ServletContext context = servlet.getServletContext(); String servletName = servlet.getServletName(); String expectedName = servletName + ".application"; Resource webInfLocation = new ContextResource(context, "/WEB-INF/"); Resource webInfAppLocation = webInfLocation.getRelativeResource(servletName + "/"); Resource result = check(webInfAppLocation, expectedName); if (result != null) return result; result = check(webInfLocation, expectedName); if (result != null) return result; // Now look for it in classpath, just in case result = _classpathResourceFactory.newResource(expectedName); if (result != null && result.getResourceURL() != null) return result; return null; }
private Resource findApplicationSpecification(HttpServlet servlet) { String path = servlet.getInitParameter(APP_SPEC_PATH_PARAM); if (path != null) return _classpathResourceFactory.newResource(path); ServletContext context = servlet.getServletContext(); String servletName = servlet.getServletName(); String expectedName = servletName + ".application"; Resource webInfLocation = new ContextResource(context, "/WEB-INF/"); Resource webInfAppLocation = webInfLocation.getRelativeResource(servletName + "/"); Resource result = check(webInfAppLocation, expectedName); if (result != null) return result; result = check(webInfLocation, expectedName); if (result != null) return result; // Now look for it in classpath, just in case result = _classpathResourceFactory.newResource(expectedName); if (result != null && result.getResourceURL() != null) return result; return null; }
public void initialize(HttpServlet servlet) { IApplicationSpecification spec = null; Resource specResource = findApplicationSpecification(servlet); if (specResource == null) { _log.warn(ImplMessages.noApplicationSpecification(servlet)); spec = constructStandinSpecification(servlet); } else spec = _parser.parseApplicationSpecification(specResource); _globals.storeActivator(new HttpServletWebActivator(servlet)); _globals.storeSpecification(spec); }