Package nsf.playground.jsp

Examples of nsf.playground.jsp.JspCompiler


      String sourceCode = null;
      try {
        JavaSnippetBean bean = (JavaSnippetBean)ManagedBeanUtil.getBean(FacesContext.getCurrentInstance(), "javaSnippetBean");
        Class<JspFragment> jspClass = bean.getCompiledClass(jspClassName);
        if(jspClass==null) {
          JspCompiler compiler = new JspCompiler();
          sourceCode = compiler.compileJsp(jsp, jspClassName);
          if(false) {
            pw.println("<pre>");
            pw.println(HtmlUtil.toHTMLContentString(sourceCode, false));
            pw.println("</pre>");
          }
          jspClass = bean.compileSnippet(jspClassName, sourceCode);
        }
        if(jspClass!=null) {
          JspFragment f = jspClass.newInstance();
          f.exec(new JspSampleWriter(pw),req,resp);
        }
      } catch(Throwable e) {
        pw.println("Execution error");
        pw.println("<pre>");
       
        StringWriter sw = new StringWriter();
        PrintWriter psw = new PrintWriter(sw);
        if(e instanceof IExceptionEx) {
          ((IExceptionEx)e).printExtraInformation(psw);
          psw.println("");
        }
        if(sourceCode==null) {
          JspCompiler compiler = new JspCompiler();
          sourceCode = compiler.compileJsp(jsp, jspClassName);
        }
        if(sourceCode!=null) {
          printSourceCode(psw,sourceCode,true,-1);
          //psw.println(HtmlUtil.toHTMLContentString(sourceCode, false));
        }
View Full Code Here

TOP

Related Classes of nsf.playground.jsp.JspCompiler

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.