<!-- to be checked on every access. -->
<!-- Used in development mode only. [4] -->
<!-- -->
+ <!-- recompileOnFail If a JSP compilation fails should the -->
+ <!-- modificationTestInterval be ignored and the -->
+ <!-- next access trigger a re-compilation attempt? -->
+ <!-- Used in development mode only and is disabled -->
+ <!-- by default as compilation may be expensive and -->
+ <!-- could lead to excessive resource usage. -->
+ <!-- [false] -->
+ <!-- -->
<!-- scratchdir What scratch directory should we use when -->
<!-- compiling JSP pages? [default work directory -->
<!-- for the current web application] -->
private int modificationTestInterval = 4;
/**
+ * Is re-compilation attempted immediately after a failure?
+ */
+ private boolean recompileOnFail = false;
+
+ /**
* Is generation of X-Powered-By response header enabled/disabled?
*/
private boolean xpoweredBy;
}
/**
+ * Re-compile on failure.
+ */
+ public boolean getRecompileOnFail() {
+ return recompileOnFail;
+ }
+
+ /**
* Is Jasper being used in development mode?
*/
public boolean getDevelopment() {
}
}
+ String recompileOnFail = config.getInitParameter("recompileOnFail");
+ if (recompileOnFail != null) {
+ if (recompileOnFail.equalsIgnoreCase("true")) {
+ this.recompileOnFail = true;
+ } else if (recompileOnFail.equalsIgnoreCase("false")) {
+ this.recompileOnFail = false;
+ } else {
+ if (log.isWarnEnabled()) {
+ log.warn(Localizer.getMessage("jsp.warning.recompileOnFail"));
+ }
+ }
+ }
String development = config.getInitParameter("development");
if (development != null) {
if (development.equalsIgnoreCase("true")) {
return 0;
}
+
+ /**
+ * In JspC this always returns <code>false</code>.
+ * {@inheritDoc}
+ */
+ public boolean getRecompileOnFail() {
+ return false;
+ }
+
+
/**
* In JspC this always returns <code>false</code>.
* {@inheritDoc}
} catch (JasperException ex) {
// Cache compilation exception
jsw.setCompilationException(ex);
+ if (options.getDevelopment() && options.getRecompileOnFail()) {
+ // Force a recompilation attempt on next access
+ jsw.setLastModificationTest(-1);
+ }
throw ex;
} catch (Exception ex) {
JasperException je = new JasperException(
*/
public int getModificationTestInterval();
+
+ /**
+ * Re-compile on failure.
+ */
+ public boolean getRecompileOnFail();
+
/**
* Is caching enabled (used for precompilation).
*/
jsp.warning.classDebugInfo=Warning: Invalid value for the initParam classdebuginfo. Will use the default value of \"false\"
jsp.warning.checkInterval=Warning: Invalid value for the initParam checkInterval. Will use the default value of \"300\" seconds
jsp.warning.modificationTestInterval=Warning: Invalid value for the initParam modificationTestInterval. Will use the default value of \"4\" seconds
+jsp.warning.recompileOnFail=Warning: Invalid value for the initParam recompileOnFail. Will use the default value of \"false\"
jsp.warning.development=Warning: Invalid value for the initParam development. Will use the default value of \"true\"
jsp.warning.fork=Warning: Invalid value for the initParam fork. Will use the default value of \"true\"
jsp.warning.reloading=Warning: Invalid value for the initParam reloading. Will use the default value of \"true\"