Return-Path:
Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org
Received: (qmail 74826 invoked from network); 4 Oct 2004 17:40:57 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199)
by minotaur-2.apache.org with SMTP; 4 Oct 2004 17:40:57 -0000
Received: (qmail 47181 invoked by uid 500); 4 Oct 2004 17:39:56 -0000
Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org
Received: (qmail 47043 invoked by uid 500); 4 Oct 2004 17:39:54 -0000
Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm
Precedence: bulk
List-Unsubscribe:
List-Subscribe:
List-Help:
List-Post:
List-Id: "Tomcat Developers List"
Reply-To: "Tomcat Developers List"
Delivered-To: mailing list tomcat-dev@jakarta.apache.org
Received: (qmail 46805 invoked by uid 500); 4 Oct 2004 17:39:49 -0000
Received: (qmail 46756 invoked by uid 99); 4 Oct 2004 17:39:48 -0000
X-ASF-Spam-Status: No, hits=-10.0 required=10.0
tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194)
by apache.org (qpsmtpd/0.28) with SMTP; Mon, 04 Oct 2004 10:39:47 -0700
Received: (qmail 74366 invoked by uid 1135); 4 Oct 2004 17:39:46 -0000
Date: 4 Oct 2004 17:39:46 -0000
Message-ID: <20041004173946.74365.qmail@minotaur.apache.org>
From: remm@apache.org
To: jakarta-tomcat-catalina-cvs@apache.org
Subject: cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml
jasper-howto.xml
X-Virus-Checked: Checked
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N
remm 2004/10/04 10:39:46
Modified: jasper2/src/share/org/apache/jasper/resources
LocalStrings.properties
jasper2/src/share/org/apache/jasper
EmbeddedServletOptions.java Options.java JspC.java
jasper2/src/share/org/apache/jasper/compiler Compiler.java
webapps/docs changelog.xml jasper-howto.xml
Log:
- Allow configuring the interval following a compilation during which a JSP will not be checked for modifications.
Revision Changes Path
1.2 +2 -1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/LocalStrings.properties
Index: LocalStrings.properties
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/LocalStrings.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LocalStrings.properties 1 Sep 2004 10:08:48 -0000 1.1
+++ LocalStrings.properties 4 Oct 2004 17:39:45 -0000 1.2
@@ -143,6 +143,7 @@
jsp.warning.sendErrToClient=Warning: Invalid value for the initParam sendErrToClient. Will use the default value of \"false\"
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 \"4000\" milliseconds
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\"
1.14 +24 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java
Index: EmbeddedServletOptions.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbeddedServletOptions.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- EmbeddedServletOptions.java 2 Sep 2004 16:05:06 -0000 1.13
+++ EmbeddedServletOptions.java 4 Oct 2004 17:39:45 -0000 1.14
@@ -164,7 +164,12 @@
*/
private String javaEncoding = "UTF8";
- /*
+ /**
+ * Modification test interval.
+ */
+ public int modificationTestInterval = 4000;
+
+ /**
* Is generation of X-Powered-By response header enabled/disabled?
*/
private boolean xpoweredBy;
@@ -226,6 +231,13 @@
}
/**
+ * Modification test interval.
+ */
+ public int getModificationTestInterval() {
+ return modificationTestInterval;
+ }
+
+ /**
* Is Jasper being used in development mode?
*/
public boolean getDevelopment() {
@@ -450,6 +462,17 @@
}
}
+ String modificationTestInterval = config.getInitParameter("modificationTestInterval");
+ if (modificationTestInterval != null) {
+ try {
+ this.modificationTestInterval = Integer.parseInt(modificationTestInterval);
+ } catch(NumberFormatException ex) {
+ if (log.isWarnEnabled()) {
+ log.warn(Localizer.getMessage("jsp.warning.modificationTestInterval"));
+ }
+ }
+ }
+
String development = config.getInitParameter("development");
if (development != null) {
if (development.equalsIgnoreCase("true")) {
@@ -589,9 +612,6 @@
}
}
- /*
- * X-Powered-By
- */
String xpoweredBy = config.getInitParameter("xpoweredBy");
if (xpoweredBy != null) {
if (xpoweredBy.equalsIgnoreCase("true")) {
1.25 +6 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java
Index: Options.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Options.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Options.java 2 Sep 2004 16:05:06 -0000 1.24
+++ Options.java 4 Oct 2004 17:39:45 -0000 1.25
@@ -164,4 +164,10 @@
* Are Text strings to be generated as char arrays?
*/
public boolean genStringAsCharArray();
+
+ /**
+ * Modification test interval.
+ */
+ public int getModificationTestInterval();
+
}
1.83 +7 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
Index: JspC.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -r1.82 -r1.83
--- JspC.java 3 Oct 2004 09:03:21 -0000 1.82
+++ JspC.java 4 Oct 2004 17:39:45 -0000 1.83
@@ -373,6 +373,13 @@
}
/**
+ * Modification test interval.
+ */
+ public int getModificationTestInterval() {
+ return 4000;
+ }
+
+ /**
* Is Jasper being used in development mode?
*/
public boolean getDevelopment() {
1.93 +2 -1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java
Index: Compiler.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- Compiler.java 16 Aug 2004 23:48:35 -0000 1.92
+++ Compiler.java 4 Oct 2004 17:39:46 -0000 1.93
@@ -321,7 +321,8 @@
boolean outDated = false;
String jsp = ctxt.getJspFile();
- if ((jsw != null) && ((jsw.getLastModificationTest() + 2000)
+ if ((jsw != null) && ((jsw.getLastModificationTest()
+ + ctxt.getOptions().getModificationTestInterval())
> System.currentTimeMillis())) {
return false;
}
1.128 +4 -0 jakarta-tomcat-catalina/webapps/docs/changelog.xml
Index: changelog.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -r1.127 -r1.128
--- changelog.xml 4 Oct 2004 15:23:59 -0000 1.127
+++ changelog.xml 4 Oct 2004 17:39:46 -0000 1.128
@@ -179,6 +179,10 @@
Fix cosmetic issue where extra CRLF would be inserted during each precompilation in web.xml. (remm)
+
+ Allow configuring the interval following a compilation during which a JSP will not be checked
+ for modifications. (remm)
+
1.17 +26 -1 jakarta-tomcat-catalina/webapps/docs/jasper-howto.xml
Index: jasper-howto.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/jasper-howto.xml,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- jasper-howto.xml 18 Sep 2004 17:09:31 -0000 1.16
+++ jasper-howto.xml 4 Oct 2004 17:39:46 -0000 1.17
@@ -117,6 +117,11 @@
print statement per input line, to ease debugging?
true
or false
, default true
.
+modificationTestInterval - Checks for modification for a given
+JSP file (and all its dependent files) will be performed only once every specified amount
+of milliseconds. Setting this to -1 will cause the JSP to be checked on every access.
+Default is 4000
milliseconds.
+
reloading - Should Jasper check for modified JSPs?
true
or false
, default false
.
@@ -129,10 +134,26 @@
+The Java compiler from Eclipse JDT in included as the default compiler. It is an
+advanced Java compiler which will load all dependencies from the Tomcat class loader,
+which will help tremendously when compiling on large installations with tens of JARs.
+On fast servers, this will allow sub-second recompilation cycles for even large JSP
+pages. This new compiler will be updated to support the Java 5 syntax as soon as
+possible.
+
+Apache Ant, which was used in previous Tomcat releases, can be used instead instead of
+the new compiler by simply removing the common/lib/jasper-compiler-jdt.jar
file,
+and placing the ant.jar
file from the latest Ant distribution in the
+common/lib
folder.
+
+The main JSP optimization which can be done is precompilation of JSPs. However,
+this might not be possible (for example, when using the jsp-property-group feature)
+or practical, in which case the configuration of the Jasper servlet becomes critical.
+
When using Jasper 2 in a production Tomcat server you should consider
making the following changes from the default configuration.
@@ -140,6 +161,9 @@
pages compilation set this to false
.
- genStrAsCharArray - To generate slightly more efficient
char arrays, set this to
true
.
+- modificationTestInterval - If development has to be set to
+
true
for any reason (such as dynamic generation of JSPs), setting
+this to a high value will improve performance a lot.
- trimSpaces - To remove useless bytes from the response,
set this to
true
.
@@ -150,7 +174,8 @@
Using Ant is the preferred way to compile web applications using JSPC.
-Use the script given below to precompile a webapp:
+Use the script given below (a similar script is included in the "deployer"
+download) to precompile a webapp:
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org