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);
}