String jspClassName = "xspjsp.jsp_"+unid;
//String jspClassName = "jsp_"+unid;
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);
}