Package org.apache.jasper.compiler

Examples of org.apache.jasper.compiler.JavaCompiler


     * SunJavaCompiler is used.
     */
    public Compiler createCompiler() throws JasperException {
  String compilerPath = options.getJspCompilerPath();
  Class jspCompilerPlugin = options.getJspCompilerPlugin();
        JavaCompiler javac;

  if (jspCompilerPlugin != null) {
            try {
                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
            } catch (Exception ex) {
    Constants.message("jsp.warning.compiler.class.cantcreate",
          new Object[] { jspCompilerPlugin, ex },
          Log.FATAL);
                javac = new SunJavaCompiler();
      }
  } else {
            javac = new SunJavaCompiler();
  }

        if (compilerPath != null)
            javac.setCompilerPath(compilerPath);

        Compiler jspCompiler = new JspCompiler(this);
  jspCompiler.setJavaCompiler(javac);
        
        return jspCompiler;
View Full Code Here


     * SunJavaCompiler is used.
     */
    public Compiler createCompiler() throws JasperException {
  String compilerPath = options.getJspCompilerPath();
  Class jspCompilerPlugin = options.getJspCompilerPlugin();
        JavaCompiler javac;

  if (jspCompilerPlugin != null) {
            try {
                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
            } catch (Exception ex) {
    Constants.message("jsp.warning.compiler.class.cantcreate",
          new Object[] { jspCompilerPlugin, ex },
          Log.FATAL);
                javac = new SunJavaCompiler();
      }
  } else {
            javac = new SunJavaCompiler();
  }

        if (compilerPath != null)
            javac.setCompilerPath(compilerPath);

        Compiler jspCompiler = new JspCompiler(this);
  jspCompiler.setJavaCompiler(javac);
        
        return jspCompiler;
View Full Code Here

      ByteArrayOutputStream out = new ByteArrayOutputStream (256);
      try {

    jspCompilerPlugin=Class.
        forName("org.apache.jasper.compiler.JikesJavaCompiler");
    JavaCompiler javaC=createJavaCompiler( jspCompilerPlugin );
   
    prepareCompiler( req, javaC, options, ctxt );
    javaC.setMsgOutput(out);
    status = javaC.compile(javaFileName);
      } catch( Exception ex ) { 
    log.log("Guess java compiler: no jikes " + ex.toString());
    status=false;
      }
      if( status==false ) {
    log.log("Guess java compiler: no jikes ");
    log.log("Guess java compiler: OUT " + out.toString());
    jspCompilerPlugin=null;
    tryJikes=false;
      } else {
    log.log("Guess java compiler: using jikes ");
      }
  }

  JavaCompiler javaC=createJavaCompiler( jspCompilerPlugin );
  prepareCompiler( req, javaC, options, ctxt );
  ByteArrayOutputStream out = new ByteArrayOutputStream (256);
  javaC.setMsgOutput(out);

  status = javaC.compile(javaFileName);

        if (!ctxt.keepGenerated()) {
            File javaFile = new File(javaFileName);
            javaFile.delete();
        }
View Full Code Here

    /** tool for customizing javac.
     */
    public JavaCompiler createJavaCompiler(Class jspCompilerPlugin )
  throws JasperException
    {
        JavaCompiler javac;

  if (jspCompilerPlugin != null) {
            try {
                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
            } catch (Exception ex) {
View Full Code Here

     * SunJavaCompiler is used.
     */
    public Compiler createCompiler() throws JasperException {
  String compilerPath = options.getJspCompilerPath();
  Class jspCompilerPlugin = options.getJspCompilerPlugin();
        JavaCompiler javac;

  if (jspCompilerPlugin != null) {
            try {
                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
            } catch (Exception ex) {
    Constants.message("jsp.warning.compiler.class.cantcreate",
          new Object[] { jspCompilerPlugin, ex },
          Logger.FATAL);
                javac = new SunJavaCompiler();
      }
  } else {
            javac = new SunJavaCompiler();
  }

        if (compilerPath != null)
            javac.setCompilerPath(compilerPath);

        Compiler jspCompiler = new JspCompiler(this);
  jspCompiler.setJavaCompiler(javac);
        
        return jspCompiler;
View Full Code Here

     * SunJavaCompiler is used.
     */
    public Compiler createCompiler() throws JasperException {
  String compilerPath = options.getJspCompilerPath();
  Class jspCompilerPlugin = options.getJspCompilerPlugin();
        JavaCompiler javac;

  if (jspCompilerPlugin != null) {
            try {
                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
            } catch (Exception ex) {
    Constants.message("jsp.warning.compiler.class.cantcreate",
          new Object[] { jspCompilerPlugin, ex },
          Logger.FATAL);
                javac = new SunJavaCompiler();
      }
  } else {
            javac = new SunJavaCompiler();
  }

        if (compilerPath != null)
            javac.setCompilerPath(compilerPath);

        Compiler jspCompiler = new JspCompiler(this);
  jspCompiler.setJavaCompiler(javac);
        
        return jspCompiler;
View Full Code Here

     * SunJavaCompiler is used.
     */
    public Compiler createCompiler() throws JasperException {
  String compilerPath = options.getJspCompilerPath();
  Class jspCompilerPlugin = options.getJspCompilerPlugin();
        JavaCompiler javac;

  if (jspCompilerPlugin != null) {
            try {
                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
            } catch (Exception ex) {
    Constants.message("jsp.warning.compiler.class.cantcreate",
          new Object[] { jspCompilerPlugin, ex },
          Logger.FATAL);
                javac = new SunJavaCompiler();
      }
  } else {
            javac = new SunJavaCompiler();
  }

        if (compilerPath != null)
            javac.setCompilerPath(compilerPath);

        Compiler jspCompiler = new JspCompiler(this);
  jspCompiler.setJavaCompiler(javac);
        
        return jspCompiler;
View Full Code Here

     * SunJavaCompiler is used.
     */
    public Compiler createCompiler() throws JasperException {
  String compilerPath = options.getJspCompilerPath();
  Class jspCompilerPlugin = options.getJspCompilerPlugin();
        JavaCompiler javac;

  if (jspCompilerPlugin != null) {
            try {
                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
            } catch (Exception ex) {
    Constants.message("jsp.warning.compiler.class.cantcreate",
          new Object[] { jspCompilerPlugin, ex },
          Logger.FATAL);
                javac = new SunJavaCompiler();
      }
  } else {
            javac = new SunJavaCompiler();
  }

        if (compilerPath != null)
            javac.setCompilerPath(compilerPath);

        Compiler jspCompiler = new JspCompiler(this);
  jspCompiler.setJavaCompiler(javac);
        
        return jspCompiler;
View Full Code Here

     * SunJavaCompiler is used.
     */
    public Compiler createCompiler() throws JasperException {
  String compilerPath = options.getJspCompilerPath();
  Class jspCompilerPlugin = options.getJspCompilerPlugin();
        JavaCompiler javac;

  if (jspCompilerPlugin != null) {
            try {
                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
            } catch (Exception ex) {
    Constants.message("jsp.warning.compiler.class.cantcreate",
          new Object[] { jspCompilerPlugin, ex },
          Logger.FATAL);
                javac = new SunJavaCompiler();
      }
  } else {
            javac = new SunJavaCompiler();
  }

        if (compilerPath != null)
            javac.setCompilerPath(compilerPath);

        Compiler jspCompiler = new JspCompiler(this);
  jspCompiler.setJavaCompiler(javac);
        
        return jspCompiler;
View Full Code Here

     * SunJavaCompiler is used.
     */
    public Compiler createCompiler() throws JasperException {
  String compilerPath = options.getJspCompilerPath();
  Class jspCompilerPlugin = options.getJspCompilerPlugin();
        JavaCompiler javac;

  if (jspCompilerPlugin != null) {
            try {
                javac = (JavaCompiler) jspCompilerPlugin.newInstance();
            } catch (Exception ex) {
    Constants.message("jsp.warning.compiler.class.cantcreate",
          new Object[] { jspCompilerPlugin, ex },
          Logger.FATAL);
                javac = new SunJavaCompiler();
      }
  } else {
            javac = new SunJavaCompiler();
  }

        if (compilerPath != null)
            javac.setCompilerPath(compilerPath);

        Compiler jspCompiler = new JspCompiler(this);
  jspCompiler.setJavaCompiler(javac);
        
        return jspCompiler;
View Full Code Here

TOP

Related Classes of org.apache.jasper.compiler.JavaCompiler

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.