Package org.apache.jasper.compiler

Examples of org.apache.jasper.compiler.Compiler


            JspCompilationContext ctxt = new JspEngineContext(parentClassLoader,
                                                  classpath, context, jspUri,
                                                  false, options,
                                                  req, res);
            Compiler compiler = ctxt.createCompiler();

            if (checkJSPmods) {
                // set the time that the jsp file has last been checked for
                // being outdated and the JSP last mod time
                lastCheckedTime = System.currentTimeMillis();
                jspLastModifiedTime = jspFile.lastModified();
            }

            // compile and load the JSP
            try {
                compiler.compile();
                loadAndInit();
            } catch (JasperException ex) {
                compileException = ex;
            } catch (FileNotFoundException ex) {
                compiler.removeGeneratedFiles();
                throw ex;
            } catch (Exception ex) {
                compileException = new JasperException(
                       Constants.getString("jsp.error.unable.compile"), ex);
            }
View Full Code Here


    /**
     * Create a compiler object for parsing only.
     */
    public Compiler createParser() throws JasperException {
        jspCompiler = new Compiler(this, jsw);
        return jspCompiler;
    }
View Full Code Here

    public Compiler createCompiler(boolean jspcMode) throws JasperException {
        if (jspCompiler != null ) {
            return jspCompiler;
        }

        jspCompiler = new Compiler(this, jsw, jspcMode);
        return jspCompiler;
    }
View Full Code Here

            Thread.currentThread().setContextClassLoader(loader);

            clctxt.setClassLoader(loader);
            clctxt.setClassPath(classPath);

            Compiler clc = clctxt.createCompiler(true);

            // If compile is set, generate both .java and .class, if
            // .jsp file is newer than .class file;
            // Otherwise only generate .java, if .jsp file is newer than
            // the .java file
            if( clc.isOutDated(compile) ) {
                clc.compile(compile);
            }

            // START SJSAS 6393940
            if (ignoreJspFragmentErrors) {
                PageInfo pi = clc.getPageInfo();
                if (pi != null) {
                    List<String> deps = pi.getDependants();
                    if (deps != null) {
                        Iterator<String> it = deps.iterator();
                        if (it != null) {
                            while (it.hasNext()) {
                                dependents.add(it.next());
                            }
                        }
                    }
                    clc.setPageInfo(null);
                }
      }
            // END SJSAS 6393940

            // Generate mapping
View Full Code Here

        jspCompiler.init(this, jsw);
        return jspCompiler;
    }

    protected Compiler createCompiler(String className) {
        Compiler compiler = null;
        try {
            compiler = (Compiler) Class.forName(className).newInstance();
        } catch (InstantiationException e) {
            JasperLogger.ROOT_LOGGER.failedLoadingJavaCompiler(className, e);
        } catch (IllegalAccessException e) {
View Full Code Here

            Thread.currentThread().setContextClassLoader(loader);

            clctxt.setClassLoader(loader);
            clctxt.setClassPath(classPath);

            Compiler clc = clctxt.createCompiler();

            // If compile is set, generate both .java and .class, if
            // .jsp file is newer than .class file;
            // Otherwise only generate .java, if .jsp file is newer than
            // the .java file
            if( clc.isOutDated(compile) ) {
                if (log.isDebugEnabled()) {
                    log.debug(jspUri + " is out dated, compiling...");
                }

                clc.compile(compile, true);
            }

            // Generate mapping
            generateWebMapping( file, clctxt );
            if ( showSuccess ) {
View Full Code Here

                initClassLoader( clctxt );

            clctxt.setClassLoader(loader);
            clctxt.setClassPath(classPath);

            Compiler clc = clctxt.createCompiler();

            // If compile is set, generate both .java and .class, if
            // .jsp file is newer than .class file;
            // Otherwise only generate .java, if .jsp file is newer than
            // the .java file
            if( clc.isOutDated(compile) ) {
                clc.compile(compile);
            }

            // Generate mapping
            generateWebMapping( file, clctxt );
            if ( showSuccess ) {
View Full Code Here

                initClassLoader( clctxt );

            clctxt.setClassLoader(loader);
            clctxt.setClassPath(classPath);

            Compiler clc = clctxt.createCompiler();

            // If compile is set, generate both .java and .class, if
            // .jsp file is newer than .class file;
            // Otherwise only generate .java, if .jsp file is newer than
            // the .java file
            if( clc.isOutDated(compile) ) {
                clc.compile(compile);
            }

            // Generate mapping
            generateWebMapping( file, clctxt );
            if ( showSuccess ) {
View Full Code Here

     */
    public Compiler createCompiler() throws JasperException {
        if (jspCompiler != null ) {
            return jspCompiler;
        }
        jspCompiler = new Compiler(this, jsw);
        return jspCompiler;
    }
View Full Code Here

     * Create a "Compiler" object based on some init param data. This
     * is not done yet. Right now we're just hardcoding the actual
     * compilers that are created.
     */
    public Compiler createCompiler() throws JasperException {
        Compiler jspCompiler = new JspCompiler(this);
        jspCompiler.setJavaCompiler(new SunJavaCompiler());
        return jspCompiler;
    }
View Full Code Here

TOP

Related Classes of org.apache.jasper.compiler.Compiler

Copyright © 2018 www.massapicom. 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.