Examples of JspC


Examples of org.apache.jasper.JspC

    }

    Thread.currentThread().setContextClassLoader(webAppClassLoader);

    if (jspc == null)
      jspc = new JspC();

    jspc.setWebXmlFragment(webXmlFragment);
    jspc.setUriroot(webAppSourceDirectory);
    jspc.setOutputDir(generatedClasses);
    jspc.setClassPath(webAppClassPath.toString());
View Full Code Here

Examples of org.apache.jasper.JspC

 
  public static void compile(File inWebDir, File outWebDir,
                               WebBundleDescriptor wbd, String classpath,
                               ServerContext serverContext)
            throws DeploymentException {
    JspC jspc = new JspC();

        if (classpath != null && classpath.length() >0) {
        jspc.setClassPath(classpath);
        }
       
        // START SJSAS 6311155
        String appName = wbd.getApplication().getName();
        boolean delegate = true;
        com.sun.enterprise.deployment.runtime.web.ClassLoader clBean =
                wbd.getSunDescriptor().getClassLoader();
        if (clBean != null) {
            String value = clBean.getAttributeValue(
                    com.sun.enterprise.deployment.runtime.web.ClassLoader.DELEGATE);
            delegate = ConfigBeansUtilities.toBoolean(value);
        }

        // so far, this is not segragated per web bundle, all web-bundles will get the
        // same sysClassPath
        String sysClassPath = ASClassLoaderUtil.getModuleClassPath(
            serverContext.getDefaultHabitat(), appName, null);
        jspc.setSystemClassPath(sysClassPath);
        // END SJSAS 6311155

    verify(inWebDir, outWebDir);

    configureJspc(jspc, wbd);
    jspc.setOutputDir(outWebDir.getAbsolutePath());
    jspc.setUriroot(inWebDir.getAbsolutePath());
    jspc.setCompile(true);
    logger.info(startMessage);

    try {
      jspc.execute();
    }
    catch (Exception je) {
      throw new DeploymentException("JSP Compilation Error: " + je, je);
    }
    finally {
View Full Code Here

Examples of org.apache.jasper.JspC

    return instance;
  }

  private void compileJsp(String forwardedUrl) throws JasperException {
    cleanCompilationDir();
    JspC jspC = new JspC();
    jspC.setUriroot(webContentPath);
    jspC.setJspFiles("." + forwardedUrl);
    jspC.setOutputDir(compilationDir.getAbsolutePath());
    jspC.setClassPath(compilationDir.getAbsolutePath());
    jspC.setCompile(true);
    LOG.debug("Compiling jsp " + forwardedUrl + " to: " + compilationDir.getAbsolutePath());
    jspC.execute();
  }
View Full Code Here

Examples of org.apache.jasper.JspC

 
  public static void compile(File inWebDir, File outWebDir,
                               WebBundleDescriptor wbd, String classpath,
                               ServerContext serverContext)
            throws DeploymentException {
    JspC jspc = new JspC();

        if (classpath != null && classpath.length() >0) {
        jspc.setClassPath(classpath);
        }
       
        // START SJSAS 6311155
        String appName = wbd.getApplication().getName();

        // so far, this is not segragated per web bundle, all web-bundles will get the
        // same sysClassPath
        String sysClassPath = ASClassLoaderUtil.getModuleClassPath(
            serverContext.getDefaultServices(), appName, null);
        jspc.setSystemClassPath(sysClassPath);
        // END SJSAS 6311155

    verify(inWebDir, outWebDir);

    configureJspc(jspc, wbd);
    jspc.setOutputDir(outWebDir.getAbsolutePath());
    jspc.setUriroot(inWebDir.getAbsolutePath());
    jspc.setCompile(true);
    logger.log(Level.INFO, START_MESSAGE);

    try {
      jspc.execute();
    }
    catch (Exception je) {
      throw new DeploymentException("JSP Compilation Error: " + je, je);
    }
    finally {
View Full Code Here

Examples of org.apache.jasper.JspC

 
  public static void compile(File inWebDir, File outWebDir,
                               WebBundleDescriptor wbd, String classpath,
                               ServerContext serverContext)
            throws DeploymentException {
    JspC jspc = new JspC();

        if (classpath != null && classpath.length() >0) {
        jspc.setClassPath(classpath);
        }
       
        // START SJSAS 6311155
        String appName = wbd.getApplication().getName();

        // so far, this is not segragated per web bundle, all web-bundles will get the
        // same sysClassPath
        String sysClassPath = ASClassLoaderUtil.getModuleClassPath(
            serverContext.getDefaultServices(), appName, null);
        jspc.setSystemClassPath(sysClassPath);
        // END SJSAS 6311155

    verify(inWebDir, outWebDir);

    configureJspc(jspc, wbd);
    jspc.setOutputDir(outWebDir.getAbsolutePath());
    jspc.setUriroot(inWebDir.getAbsolutePath());
    jspc.setCompile(true);
    logger.log(Level.INFO, START_MESSAGE);

    try {
      jspc.execute();
    }
    catch (Exception je) {
      throw new DeploymentException("JSP Compilation Error: " + je, je);
    }
    finally {
View Full Code Here

Examples of org.apache.struts2.jasper.JspC

        if (LOG.isDebugEnabled()) {
            LOG.debug("Compiling JSP [#0]", location);
        }

        //use Jasper to compile the JSP into java code
        JspC jspC = compileJSP(location);
        String source = jspC.getSourceCode();

        //System.out.print(source);

        String className = extractClassName(source);

        //use Java Compiler API to compile the java code into a class
        //the tlds that were discovered are added (their jars) to the classpath
        compileJava(className, source, jspC.getTldAbsolutePaths());

        //load the class that was just built
        Class clazz = Class.forName(className, false, classLoader);
        return createServlet(clazz);
    }
View Full Code Here

Examples of org.apache.struts2.jasper.JspC

        File file = FileUtils.toFile(loc);
        return file.getAbsolutePath();
    }

    private JspC compileJSP(String location) throws JasperException {
        JspC jspC = new JspC();
        jspC.setClassLoaderInterface(getClassLoaderInterface());
        jspC.setCompile(false);
        jspC.setJspFiles(location);
        jspC.setPackage(DEFAULT_PACKAGE);
        jspC.execute();
        return jspC;
    }
View Full Code Here

Examples of org.apache.struts2.jasper.JspC

        if (LOG.isDebugEnabled()) {
            LOG.debug("Compiling JSP [#0]", location);
        }

        //use Jasper to compile the JSP into java code
        JspC jspC = compileJSP(location);
        String source = jspC.getSourceCode();

        //System.out.print(source);

        String className = extractClassName(source);

        //use Java Compiler API to compile the java code into a class
        //the tlds that were discovered are added (their jars) to the classpath
        compileJava(className, source, jspC.getTldAbsolutePaths());

        //load the class that was just built
        Class clazz = Class.forName(className, false, classLoader);
        return createServlet(clazz);
    }
View Full Code Here

Examples of org.apache.struts2.jasper.JspC

        File file = FileUtils.toFile(loc);
        return file.getAbsolutePath();
    }

    private JspC compileJSP(String location) throws JasperException {
        JspC jspC = new JspC();
        jspC.setClassLoaderInterface(getClassLoaderInterface());
        jspC.setCompile(false);
        jspC.setJspFiles(location);
        jspC.setPackage(DEFAULT_PACKAGE);
        jspC.execute();
        return jspC;
    }
View Full Code Here

Examples of org.apache.struts2.jasper.JspC

        if (LOG.isDebugEnabled()) {
            LOG.debug("Compiling JSP [#0]", location);
        }

        //use Jasper to compile the JSP into java code
        JspC jspC = compileJSP(location);
        String source = jspC.getSourceCode();

        //System.out.print(source);

        String className = extractClassName(source);

        //use Java Compiler API to compile the java code into a class
        //the tlds that were discovered are added (their jars) to the classpath
        compileJava(className, source, jspC.getTldAbsolutePaths());

        //load the class that was just built
        Class clazz = Class.forName(className, false, classLoader);
        return createServlet(clazz);
    }
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.