MCPcopy Index your code
hub / github.com/apache/tomcat / initServletContext

Method initServletContext

java/org/apache/jasper/JspC.java:1770–1793  ·  view source on GitHub ↗

Initializes the servlet context, TLD scanner, TLD cache, runtime context, JSP config, and tag plugin manager for compilation. @param classLoader The class loader to use @throws IOException If an I/O error occurs @throws JasperException If a JSP error occurs

(ClassLoader classLoader)

Source from the content-addressed store, hash-verified

1768 * @throws JasperException If a JSP error occurs
1769 */
1770 protected void initServletContext(ClassLoader classLoader) throws IOException, JasperException {
1771 // TODO: should we use the Ant Project's log?
1772 PrintWriter log = new PrintWriter(System.out);
1773 URL resourceBase = new File(uriRoot).getCanonicalFile().toURI().toURL();
1774
1775 context = new JspCServletContext(log, resourceBase, classLoader, isValidateXml(), isBlockExternal());
1776 if (isValidateTld()) {
1777 context.setInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM, "true");
1778 }
1779
1780
1781 initTldScanner(context, classLoader);
1782
1783 try {
1784 scanner.scan();
1785 } catch (SAXException e) {
1786 throw new JasperException(e);
1787 }
1788 tldCache = new TldCache(context, scanner.getUriTldResourcePathMap(), scanner.getTldResourcePathTaglibXmlMap());
1789 context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME, tldCache);
1790 rctxt = new JspRuntimeContext(context, this);
1791 jspConfig = new JspConfig(context);
1792 tagPluginManager = new TagPluginManager(context);
1793 }
1794
1795 /**
1796 * Initializes the classloader as/if needed for the given compilation context.

Callers 1

executeMethod · 0.95

Calls 9

isValidateXmlMethod · 0.95
isBlockExternalMethod · 0.95
isValidateTldMethod · 0.95
initTldScannerMethod · 0.95
setInitParameterMethod · 0.65
scanMethod · 0.65
setAttributeMethod · 0.65

Tested by

no test coverage detected