Exemplo n.º 1
0
  protected void initServletContext(ClassLoader classLoader) throws IOException, JasperException {
    // TODO: should we use the Ant Project's log?
    PrintWriter log = new PrintWriter(System.out);
    URL resourceBase = new File(uriRoot).getCanonicalFile().toURI().toURL();

    context =
        new JspCServletContext(log, resourceBase, classLoader, isValidateXml(), isBlockExternal());
    if (isValidateTld()) {
      context.setInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM, "true");
    }

    initTldScanner(context, classLoader);

    try {
      scanner.scan();
    } catch (SAXException e) {
      throw new JasperException(e);
    }
    tldCache =
        new TldCache(
            context, scanner.getUriTldResourcePathMap(), scanner.getTldResourcePathTaglibXmlMap());
    context.setAttribute(TldCache.SERVLET_CONTEXT_ATTRIBUTE_NAME, tldCache);
    rctxt = new JspRuntimeContext(context, this);
    jspConfig = new JspConfig(context);
    tagPluginManager = new TagPluginManager(context);
  }
Exemplo n.º 2
0
  protected void initTldScanner(JspCServletContext context, ClassLoader classLoader) {
    if (scanner != null) {
      return;
    }

    scanner = newTldScanner(context, true, isValidateTld(), isBlockExternal());
    scanner.setClassLoader(classLoader);
  }