Package org.apache.jasper

Examples of org.apache.jasper.JspCompilationContext


        ServletContext sContext = new JspCServletContext(logWriter, baseUrl);
        ServletConfig sConfig = new MockServletConfig(sContext);
        Options options = createOptions(sContext, sConfig, info);
        JspRuntimeContext rtContext = new JspRuntimeContext(sContext, options);
        JspServletWrapper sWrapper = makeWrapper(sContext, options, rtContext);
        JspCompilationContext cContext = createJspCompilationContext(info, sContext, options,
                rtContext, sWrapper, new StringWriter());
        logCompilation(info.getJspSource(), info.getClassOutputDir());
        compileJspToJava(sWrapper, cContext);
        File javaFile = new File(info.getJavaSource());
        assertTrue("Failed to generate .java source code to " + javaFile.getAbsolutePath(),
View Full Code Here


    private JspCompilationContext createJspCompilationContext(JspCompilationInfo info,
            ServletContext servletContext, Options options, JspRuntimeContext jspRuntimeContext,
            JspServletWrapper jspServletWrapper, StringWriter stringWriter) {
        boolean isErrorPage = false;
        JspCompilationContext cContext = new JspCompilationContext(info.getJspPath(), isErrorPage,
                options, servletContext, jspServletWrapper, jspRuntimeContext);
        cContext.getOutputDir(); // forces creation of the directory tree
        cContext.setServletJavaFileName(info.getJavaSource());
        cContext.setServletPackageName(getJspPackageName());
        cContext.setWriter(new ServletWriter(new PrintWriter(stringWriter)));
        createPathToGeneratedJavaSource(info);
        return cContext;
    }
View Full Code Here

     */
    private void checkCompile() {
        Object [] wrappers = jsps.values().toArray();
        for (int i = 0; i < wrappers.length; i++ ) {
            JspServletWrapper jsw = (JspServletWrapper)wrappers[i];
            JspCompilationContext ctxt = jsw.getJspEngineContext();
            // JspServletWrapper also synchronizes on this when
            // it detects it has to do a reload
            synchronized(jsw) {
                try {
                    ctxt.compile();
                } catch (FileNotFoundException ex) {
                    ctxt.incrementRemoved();
                } catch (Throwable t) {
                    jsw.getServletContext().log("Background compile failed",
            t);
                }
            }
View Full Code Here

  this.isTagFile = false;
        this.config = config;
        this.options = options;
        this.jspUri = jspUri;
        ctxt = new JspCompilationContext(jspUri, isErrorPage, options,
           config.getServletContext(),
           this, rctxt);
    }
View Full Code Here

  this.isTagFile = true;
        this.config = null// not used
        this.options = options;
  this.jspUri = tagFilePath;
  this.tripCount = 0;
        ctxt = new JspCompilationContext(jspUri, tagInfo, options,
           servletContext, this, rctxt,
           tagFileJarUrl);
    }
View Full Code Here

   * Constructor
   */
  DirectiveVisitor(Compiler compiler) throws JasperException {
      this.pageInfo = compiler.getPageInfo();
      this.err = compiler.getErrorDispatcher();
      JspCompilationContext ctxt = compiler.getCompilationContext();
  }
View Full Code Here

     */
    private void checkCompile() {
        Object [] wrappers = jsps.values().toArray();
        for (int i = 0; i < wrappers.length; i++ ) {
            JspServletWrapper jsw = (JspServletWrapper)wrappers[i];
            JspCompilationContext ctxt = jsw.getJspEngineContext();
            // JspServletWrapper also synchronizes on this when
            // it detects it has to do a reload
            synchronized(jsw) {
                try {
                    ctxt.compile();
                } catch (FileNotFoundException ex) {
                    ctxt.incrementRemoved();
                } catch (Throwable t) {
                    jsw.getServletContext().log("Background compile failed",t);
                }
            }
        }
View Full Code Here

            throws JasperException {

        this.config = config;
        this.options = options;
        this.jspUri = jspUri;
        ctxt = new JspCompilationContext( jspUri, isErrorPage,
                                          options,
                                          config.getServletContext(),
                                          this, rctxt);
        ctxt.createOutdir();
    }
View Full Code Here

        }
       
        Object [] wrappers = jsps.values().toArray();
        for (int i = 0; i < wrappers.length; i++ ) {
            JspServletWrapper jsw = (JspServletWrapper)wrappers[i];
            JspCompilationContext ctxt = jsw.getJspEngineContext();
            // JspServletWrapper also synchronizes on this when
            // it detects it has to do a reload
            synchronized(jsw) {
                try {
                    ctxt.compile();
                } catch (FileNotFoundException ex) {
                    ctxt.incrementRemoved();
                } catch (Throwable t) {
                    jsw.getServletContext().log("Background compile failed",
            t);
                }
            }
View Full Code Here

                Constants.message("jsp.message.context.classpath",
                                  new Object[] {
                                      classpath == null ? "<none>" : classpath
                                  }, Logger.DEBUG);

            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();
View Full Code Here

TOP

Related Classes of org.apache.jasper.JspCompilationContext

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.