Examples of JspEngineContext


Examples of org.apache.jasper.JspEngineContext

  boolean isErrorPage, HttpServletRequest req, HttpServletResponse res)
  throws JasperException, FileNotFoundException
    {
  Class jspClass = (Class) loadedJSPs.get(name);
  boolean firstTime = jspClass == null;
        JspCompilationContext ctxt = new JspEngineContext(loader, classpath,
                                                     context, name,
                                                     isErrorPage, options,
                                                     req, res);
  boolean outDated = false;

        Compiler compiler = ctxt.createCompiler();
       
        try {
            outDated = compiler.compile();
            if ((jspClass == null) || (compiler.isOutDated())) {
                synchronized ( this ) {
                    if ((jspClass == null) || (compiler.isOutDated() ))
                        outDated = compiler.compile();
                }
            }
        } catch (FileNotFoundException ex) {
            throw ex;
        } catch (JasperException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new JasperException(Constants.getString("jsp.error.unable.compile"),
                                      ex);
        }

  // Reload only if it's outdated
  if((jspClass == null) || outDated) {
      try {
    if( null ==ctxt.getServletClassName() ) {
        compiler.computeServletClassName();
    }
    jspClass = loader.loadClass(ctxt.getFullClassName());
                        //loadClass(ctxt.getFullClassName(), true);
      } catch (ClassNotFoundException cex) {
    throw new JasperException(Constants.getString("jsp.error.unable.load"),
            cex);
      }
View Full Code Here

Examples of org.apache.jasper.JspEngineContext

            }
        } catch(Exception e) {
            throw new JasperException("No output directory: " + e.getMessage());
        }
  boolean firstTime = jsw.servletClass == null;
        JspCompilationContext ctxt = new JspEngineContext(parentClassLoader, classpath,
                                                     context, jspUri, outDir.toString() + File.separator,
                                                     isErrorPage, options,
                                                     req, res);
  boolean outDated = false;

        Compiler compiler = ctxt.createCompiler();
       
        try {
            outDated = compiler.compile();
            if ( (jsw.servletClass == null) || (compiler.isOutDated()) ) {
                synchronized ( this ) {
                    if ((jsw.servletClass == null) ||
      (compiler.isOutDated() ))  {
                        outDated = compiler.compile();
                    }
    }
            }
        } catch (FileNotFoundException ex) {
            compiler.removeGeneratedFiles();
            throw ex;
        } catch (JasperException ex) {
            throw ex;
        } catch (Exception ex) {
      throw new JasperException(Constants.getString("jsp.error.unable.compile"),
                                      ex);
  }

  // Reload only if it's outdated
  if((jsw.servletClass == null) || outDated) {
      try {
    URL [] urls = new URL[1];
                File outputDir = new File(normalize(ctxt.getOutputDir()));
                urls[0] = outputDir.toURL();
                jsw.loader = new JasperLoader(urls,ctxt.getServletClassName(),
                parentClassLoader,
                permissionCollection,
                codeSource);
    jsw.servletClass = jsw.loader.loadClass(
      Constants.JSP_PACKAGE_NAME + "." + ctxt.getServletClassName());
      } catch (ClassNotFoundException cex) {
    throw new JasperException(
        Constants.getString("jsp.error.unable.load"),cex);
      } catch (MalformedURLException mue) {
                throw new JasperException(
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.