Package org.apache.sling.scripting.jsp.jasper.compiler

Examples of org.apache.sling.scripting.jsp.jasper.compiler.Compiler


    }

    // ==================== Compile and reload ====================

    public JasperException compile() {
        final Compiler c = createCompiler();
        try {
            c.removeGeneratedFiles();
            c.compile();
        } catch (final JasperException ex) {
            return ex;
        } catch (final IOException ioe) {
            final JasperException je = new JasperException(
                    Localizer.getMessage("jsp.error.unable.compile"),
                    ioe);
            return je;
        } catch (final Exception ex) {
            JasperException je = new JasperException(
                        Localizer.getMessage("jsp.error.unable.compile"),
                        ex);
            return je;
        } finally {
           c.clean();
        }

        return null;
    }
View Full Code Here


            if (loader == null) {
                initClassLoader();
            }
            Thread.currentThread().setContextClassLoader(loader);

            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, true);

                if (showSuccess) {
                    getLog().info("Built File: " + file);
                }
            } else if (showSuccess) {
View Full Code Here

            // we only use the class loader and do not need the class path
            clctxt.setClassLoader(loader);
            clctxt.setClassPath(null);

            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, true);

                if (showSuccess) {
                    getLog().info("Built File: " + file);
                }
            } else if (showSuccess) {
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) {
            log.warn(Localizer.getMessage("jsp.error.compiler"), e);
        } catch (IllegalAccessException e) {
View Full Code Here

TOP

Related Classes of org.apache.sling.scripting.jsp.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.