org.apache.jasper.servlet.JspCServletContext Java Examples

The following examples show how to use org.apache.jasper.servlet.JspCServletContext. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JspC.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
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);
    if (isValidateTld()) {
        context.setInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM, "true");
    }
    if (isValidateXml()) {
        context.setInitParameter(Constants.XML_VALIDATION_INIT_PARAM, "true");
    }
    context.setInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM,
            String.valueOf(isBlockExternal()));

    tldLocationsCache = TldLocationsCache.getInstance(context);
    rctxt = new JspRuntimeContext(context, this);
    jspConfig = new JspConfig(context);
    tagPluginManager = new TagPluginManager(context);
}
 
Example #2
Source File: JspC.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
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);
    if (isValidateTld()) {
        context.setInitParameter(Constants.XML_VALIDATION_TLD_INIT_PARAM, "true");
    }
    if (isValidateXml()) {
        context.setInitParameter(Constants.XML_VALIDATION_INIT_PARAM, "true");
    }
    context.setInitParameter(Constants.XML_BLOCK_EXTERNAL_INIT_PARAM,
            String.valueOf(isBlockExternal()));

    tldLocationsCache = TldLocationsCache.getInstance(context);
    rctxt = new JspRuntimeContext(context, this);
    jspConfig = new JspConfig(context);
    tagPluginManager = new TagPluginManager(context);
}
 
Example #3
Source File: JspC.java    From packagedrone with Eclipse Public License 1.0 6 votes vote down vote up
private void initServletContext() {
    try {
        context =new JspCServletContext
            (new PrintWriter(new OutputStreamWriter(System.out, "UTF-8")),

             new URL("file:" + uriRoot.replace('\\','/') + '/'));
        tldScanner = new TldScanner(context, isValidationEnabled);

        // START GlassFish 750
        taglibs = new ConcurrentHashMap<String, TagLibraryInfo>();
        context.setAttribute(Constants.JSP_TAGLIBRARY_CACHE, taglibs);

        tagFileJarUrls = new ConcurrentHashMap<String, URL>();
        context.setAttribute(Constants.JSP_TAGFILE_JAR_URLS_CACHE,
                             tagFileJarUrls);
        // END GlassFish 750
    } catch (MalformedURLException me) {
        System.out.println("**" + me);
    } catch (UnsupportedEncodingException ex) {
    }
    rctxt = new JspRuntimeContext(context, this);
    jspConfig = new JspConfig(context);
    tagPluginManager = new TagPluginManager(context);
}
 
Example #4
Source File: JspC.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
protected void initTldScanner(JspCServletContext context, ClassLoader classLoader) {
    if (scanner != null) {
        return;
    }

    scanner = newTldScanner(context, true, isValidateTld(), isBlockExternal());
    scanner.setClassLoader(classLoader);
}
 
Example #5
Source File: JspC.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
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);
}
 
Example #6
Source File: JspC.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
protected TldScanner newTldScanner(JspCServletContext context, boolean namespaceAware,
        boolean validate, boolean blockExternal) {
    return new TldScanner(context, namespaceAware, validate, blockExternal);
}