@Override public String getServletFileNameForJsp(Context context, String jspName) { String servletName = null; ServletConfig servletConfig = (ServletConfig) context.findChild("jsp"); if (servletConfig != null) { ServletContext sctx = context.getServletContext(); Options opt = new EmbeddedServletOptions(servletConfig, sctx); JspRuntimeContext jrctx = new JspRuntimeContext(sctx, opt); JspCompilationContext jcctx = createJspCompilationContext(jspName, opt, sctx, jrctx, null); servletName = jcctx.getServletJavaFileName(); } else { logger.error(NO_JSP_SERVLET, context.getName()); } return servletName; }
public void destroy() { rctxt.destroy(); }
@Override public void periodicEvent() { rctxt.checkUnload(); rctxt.checkCompile(); }
Options opt = new EmbeddedServletOptions(servletConfig, sctx); JspRuntimeContext jrctx = new JspRuntimeContext(sctx, opt); try { if (summary.getItems() == null) { jrctx.destroy();
private void serviceJspFile(HttpServletRequest request, HttpServletResponse response, String jspUri, boolean precompile) throws ServletException, IOException { JspServletWrapper wrapper = rctxt.getWrapper(jspUri); if (wrapper == null) { synchronized(this) { wrapper = rctxt.getWrapper(jspUri); if (wrapper == null) { // Check if the requested JSP page exists, to avoid // creating unnecessary directories and files. if (null == context.getResource(jspUri)) { handleMissingResource(request, response, jspUri); return; } wrapper = new JspServletWrapper(config, options, jspUri, rctxt); rctxt.addWrapper(jspUri,wrapper); } } } try { wrapper.service(request, response, precompile); } catch (FileNotFoundException fnfe) { handleMissingResource(request, response, jspUri); } }
public ClassLoader getJspLoader() { return new JasperLoader(new URL[] {baseUrl}, getClassLoader(), rctxt.getPermissionCollection(), rctxt.getCodeSource(), rctxt.getBytecodes()); }
/** * Gets the number of JSPs that have been reloaded. * * <p>This info may be used for monitoring purposes. * * @return The number of JSPs (in the webapp with which this JspServlet is * associated) that have been reloaded */ public int getJspReloadCount() { return this.rctxt.getJspReloadCount(); }
/** * What class loader to use for loading classes while compiling * this JSP? */ public ClassLoader getClassLoader() { if( loader != null ) return loader; return rctxt.getParentClassLoader(); }
/** * The classpath that is passed off to the Java compiler. */ public String getClassPath() { if( classPath != null ) { return classPath; } return rctxt.getClassPath(); }
/** * Returns the number of JSPs for which JspServletWrappers exist, i.e., * the number of JSPs that have been loaded into the webapp with which * this JspServlet is associated. * * <p>This info may be used for monitoring purposes. * * @return The number of JSPs that have been loaded into the webapp with * which this JspServlet is associated */ public int getJspCount() { return this.rctxt.getJspCount(); }
/** * The background thread that checks for changes to files * included by a JSP and flags that a recompile is required. */ public void run() { // Loop until the termination semaphore is set while (!threadDone) { // Wait for our check interval threadSleep(); // Check for included files which are newer than the // JSP which uses them. try { checkCompile(); } catch (Throwable t) { t.printStackTrace(); } } }
public ClassLoader getJspLoader() { if( jspLoader == null ) { jspLoader = new JasperLoader (new URL[] {baseUrl}, getClassLoader(), rctxt.getPermissionCollection(), rctxt.getCodeSource()); } return jspLoader; }
public ClassLoader getJspLoader() { if( jspLoader == null ) { jspLoader = new JasperLoader (new URL[] {baseUrl}, getClassLoader(), rctxt.getPermissionCollection()); } return jspLoader; }
public void periodicEvent() { rctxt.checkCompile(); }
private void serviceJspFile(HttpServletRequest request, HttpServletResponse response, String jspUri, boolean precompile) throws ServletException, IOException { JspServletWrapper wrapper = rctxt.getWrapper(jspUri); if (wrapper == null) { synchronized(this) { wrapper = rctxt.getWrapper(jspUri); if (wrapper == null) { // Check if the requested JSP page exists, to avoid // creating unnecessary directories and files. if (null == context.getResource(jspUri)) { handleMissingResource(request, response, jspUri); return; } wrapper = new JspServletWrapper(config, options, jspUri, rctxt); rctxt.addWrapper(jspUri,wrapper); } } } try { wrapper.service(request, response, precompile); } catch (FileNotFoundException fnfe) { handleMissingResource(request, response, jspUri); } }
public ClassLoader getJspLoader() { return new JasperLoader(new URL[] {baseUrl}, getClassLoader(), rctxt.getPermissionCollection(), rctxt.getCodeSource(), rctxt.getBytecodes()); }
/** * Gets the number of JSPs that have been reloaded. * * <p>This info may be used for monitoring purposes. * * @return The number of JSPs (in the webapp with which this JspServlet is * associated) that have been reloaded */ public int getJspReloadCount() { return this.rctxt.getJspReloadCount(); }
/** * What class loader to use for loading classes while compiling * this JSP? */ public ClassLoader getClassLoader() { if( loader != null ) return loader; return rctxt.getParentClassLoader(); }
/** * The classpath that is passed off to the Java compiler. */ public String getClassPath() { if( classPath != null ) return classPath; return rctxt.getClassPath(); }
/** * Returns the number of JSPs for which JspServletWrappers exist, i.e., * the number of JSPs that have been loaded into the webapp with which * this JspServlet is associated. * * <p>This info may be used for monitoring purposes. * * @return The number of JSPs that have been loaded into the webapp with * which this JspServlet is associated */ public int getJspCount() { return this.rctxt.getJspCount(); }