Examples of JspCompilationContext


Examples of org.apache.sling.scripting.jsp.jasper.JspCompilationContext

     * Compiles and loads a tagfile.
     */
    private Class loadTagFile(Compiler compiler, String tagFilePath,
            TagInfo tagInfo, PageInfo parentPageInfo) throws JasperException {

        JspCompilationContext ctxt = compiler.getCompilationContext();
        JspRuntimeContext rctxt = ctxt.getRuntimeContext();

        rctxt.lockTagFileLoading(tagFilePath);
        try {

            JspServletWrapper wrapper = rctxt.getWrapper(tagFilePath);

            if (wrapper == null) {
                wrapper = new JspServletWrapper(ctxt.getServletContext(), ctxt
                      .getOptions(), tagFilePath, tagInfo, ctxt
                      .getRuntimeContext(), compiler.getDefaultIsSession(),
                      ctxt.getTagFileJarUrl(tagFilePath));
                wrapper = rctxt.addWrapper(tagFilePath, wrapper);

                // Use same classloader and classpath for compiling tag files
                //wrapper.getJspEngineContext().setClassLoader(ctxt.getClassLoader());
                //wrapper.getJspEngineContext().setClassPath(ctxt.getClassPath());
            } else {
                // Make sure that JspCompilationContext gets the latest TagInfo
                // for the tag file. TagInfo instance was created the last
                // time the tag file was scanned for directives, and the tag
                // file may have been modified since then.
                wrapper.getJspEngineContext().setTagInfo(tagInfo);
            }

            Class tagClazz;
            int tripCount = wrapper.incTripCount();
            try {
                if (tripCount > 0) {
                    // When tripCount is greater than zero, a circular
                    // dependency exists. The circularily dependant tag
                    // file is compiled in prototype mode, to avoid infinite
                    // recursion.

                    JspServletWrapper tempWrapper = new JspServletWrapper(ctxt
                          .getServletContext(), ctxt.getOptions(),
                          tagFilePath, tagInfo, ctxt.getRuntimeContext(),
                          compiler.getDefaultIsSession(),
                          ctxt.getTagFileJarUrl(tagFilePath));
                    tagClazz = tempWrapper.loadTagFilePrototype();
                    tempVector.add(tempWrapper.getJspEngineContext()
                          .getCompiler());
                } else {
                    tagClazz = wrapper.loadTagFile();
View Full Code Here

Examples of org.apache.struts2.jasper.JspCompilationContext

        this.isTagFile = false;
        this.config = config;
        this.options = options;
        this.jspUri = jspUri;
        ctxt = new JspCompilationContext(jspUri, isErrorPage, options,
                config.getServletContext(),
                this, rctxt, null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.