Examples of JspCompilationInfo


Examples of net.sf.jsptest.compiler.JspCompilationInfo

     *            The path to the JSP source file to compile, given relative to the web root.
     * @param mockTaglibs
     *            Mapping of tag names to tag handler classes
     */
    public JspCompilationInfo compile(String path, Map mockTaglibs) throws Exception {
        JspCompilationInfo info = createJspCompilationInfo(path, mockTaglibs);
        if (info.jspCompilationRequired()) {
            compileJsp(info);
            compileJavaToBytecode(info);
        } else {
            log.debug("  No compilation needed for " + info.getJspSource());
        }
        return info;
    }
View Full Code Here

Examples of net.sf.jsptest.compiler.JspCompilationInfo

            return "jsp";
        }
    }

    private JspCompilationInfo createJspCompilationInfo(String jsp, Map mockTaglibs) {
        JspCompilationInfo info = new JspCompilationInfo();
        info.setJspPath(jsp);
        info.setClassOutputDir(classOutputBaseDir);
        info.setJspSource(resolveJspSourceFile(jsp));
        info.setWebRoot(getWebRoot());
        info.setTaglibs(mockTaglibs);
        resolveJavaSourceFile(info);
        resolveClassFileLocation(info);
        resolveClassName(info);
        return info;
    }
View Full Code Here

Examples of net.sf.jsptest.compiler.JspCompilationInfo

    public Jsp compile(final String jspPath, Map taglibs) {
        try {
            JasperCompiler compiler = new JasperCompiler();
            compiler.setWebRoot(getWebRoot());
            compiler.setClassOutputBaseDir(getOutputDirectory());
            JspCompilationInfo info = compiler.compile(jspPath, taglibs);
            final Class servletClass = compileToClass(info);
            return new JspImpl(servletClass);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of net.sf.jsptest.compiler.JspCompilationInfo

            throw new RuntimeException(pageContext.getException());
        }
    }

    private Class compileToClass(String path) throws Exception, ClassNotFoundException {
        JspCompilationInfo compilation = getCompiler().compile(path, mockTaglibs);
        return loadJspClass(compilation.getClassName());
    }
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.