cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jasper-howto.xml
remm2005/04/04 04:11:51 Modified:jasper2/src/share/org/apache/jasper/servlet JspServlet.java webapps/docs changelog.xml jasper-howto.xml Log: - 34272: Add options class configuration. - Submitted by Scott Stark. Revision ChangesPath 1.42 +36 -13 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServlet.java Index: JspServlet.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServlet.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- JspServlet.java 21 Mar 2005 15:38:12 - 1.41 +++ JspServlet.java 4 Apr 2005 11:11:50 - 1.42 @@ -17,6 +17,7 @@ package org.apache.jasper.servlet; import java.io.IOException; +import java.lang.reflect.Constructor; import java.util.Enumeration; import javax.servlet.ServletConfig; @@ -66,20 +67,42 @@ * Initializes this JspServlet. */ public void init(ServletConfig config) throws ServletException { - - super.init(config); - this.config = config; - this.context = config.getServletContext(); - + +super.init(config); +this.config = config; +this.context = config.getServletContext(); + // Initialize the JSP Runtime Context -options = new EmbeddedServletOptions(config, context); -rctxt = new JspRuntimeContext(context,options); - - if (log.isDebugEnabled()) { - log.debug(Localizer.getMessage(jsp.message.scratch.dir.is, -options.getScratchDir().toString())); - log.debug(Localizer.getMessage(jsp.message.dont.modify.servlets)); - } +// Check for a custom Options implementation +String engineOptionsName = +config.getInitParameter(engineOptionsClass); +if (engineOptionsName != null) { +// Instantiate the indicated Options implementation +try { +ClassLoader loader = Thread.currentThread() +.getContextClassLoader(); +Class engineOptionsClass = loader.loadClass(engineOptionsName); +Class[] ctorSig = { ServletConfig.class, ServletContext.class }; +Constructor ctor = engineOptionsClass.getConstructor(ctorSig); +Object[] args = { config, context }; +options = (Options) ctor.newInstance(args); +} catch (Throwable e) { +// Need to localize this. +log.warn(Failed to load engineOptionsClass, e); +// Use the default Options implementation +options = new EmbeddedServletOptions(config, context); +} +} else { +// Use the default Options implementation +options = new EmbeddedServletOptions(config, context); +} +rctxt = new JspRuntimeContext(context, options); + +if (log.isDebugEnabled()) { +log.debug(Localizer.getMessage(jsp.message.scratch.dir.is, +options.getScratchDir().toString())); + log.debug(Localizer.getMessage(jsp.message.dont.modify.servlets)); +} } 1.281 +9 -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.280 retrieving revision 1.281 diff -u -r1.280 -r1.281 --- changelog.xml 3 Apr 2005 16:06:11 - 1.280 +++ changelog.xml 4 Apr 2005 11:11:51 - 1.281 @@ -68,6 +68,10 @@ Read patch causing Session.getId to throw an ISE, and make all internal components use a safe getIdInternal method (remm) /update + update +Store principal to be exposed for Request.getUserPrincipal inside the GenericPrincipal, +to remove hacks from the JAAS realm (remm) + /update /changelog /subsection @@ -76,8 +80,13 @@ fix bug18477/bug: Allow symbolic links when precompiling JSPs (markt) /fix + add +bug34727/bug: Allow specifying the Option class used by the Jasper engine, +submitted by Scott Stark (remm) + /add /changelog /subsection + subsection name=Cluster changelog update 1.26 +5 -0 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
cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jasper-howto.xml
yoavs 2005/03/30 08:52:52 Modified:webapps/docs changelog.xml jasper-howto.xml Log: Bugzilla 33522. Revision ChangesPath 1.275 +8 -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.274 retrieving revision 1.275 diff -u -r1.274 -r1.275 --- changelog.xml 29 Mar 2005 21:54:14 - 1.274 +++ changelog.xml 30 Mar 2005 16:52:52 - 1.275 @@ -27,6 +27,14 @@ /section section name=Tomcat 5.5.10 (yoavs) + subsection name=General +changelog + update +bug33522/bug: Update jasper-howto to reflect use of javac switch. (yoavs) + /update +/changelog + /subsection + subsection name=Catalina changelog fix 1.25 +2 -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.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- jasper-howto.xml 3 Dec 2004 15:17:34 - 1.24 +++ jasper-howto.xml 30 Mar 2005 16:52:52 - 1.25 @@ -148,7 +148,8 @@ pApache Ant, which was used in previous Tomcat releases, can be used instead instead of the new compiler by simply removing the codecommon/lib/jasper-compiler-jdt.jar/code file, and placing the codeant.jar/code file from the latest Ant distribution in the -codecommon/lib/code folder./p +codecommon/lib/code folder. If you do this, you also need to use the javac +argument to catalina.sh./p /section - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jasper-howto.xml
yoavs 2004/12/03 07:17:34 Modified:catalina/src/conf web.xml webapps/docs changelog.xml jasper-howto.xml Log: Updated Jikes section of Jasper-HowTo, and updated conf/web.xml to point people there. Revision ChangesPath 1.54 +2 -5 jakarta-tomcat-catalina/catalina/src/conf/web.xml Index: web.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/conf/web.xml,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- web.xml 17 Nov 2004 14:35:30 - 1.53 +++ web.xml 3 Dec 2004 15:17:34 - 1.54 @@ -185,11 +185,8 @@ !-- header is added by generated servlet [false] -- !-- -- !-- If you wish to use Jikes to compile JSP pages: -- - !-- Set the init parameter compiler to jikes. Define -- - !-- the property -Dbuild.compiler.emacs=true when starting Tomcat -- - !-- by adding the above to your CATALINA_OPTS environment variable. -- - !-- If you get an error reporting that jikes can't use UTF8 encoding, -- - !-- try setting the init parameter javaEncoding to ISO-8859-1. -- + !-- Please see the Using Jikes section of the Jasper-HowTo -- + !-- page in the Tomcat documentation. -- servlet servlet-namejsp/servlet-name 1.194 +15 -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.193 retrieving revision 1.194 diff -u -r1.193 -r1.194 --- changelog.xml 2 Dec 2004 06:03:43 - 1.193 +++ changelog.xml 3 Dec 2004 15:17:34 - 1.194 @@ -26,6 +26,21 @@ /p /section +section name=Tomcat 5.5.6 (yoavs) + subsection name=General +changelog +/changelog + /subsection + + subsection name=Jasper +changelog + update +Updated Jasper-HowTo section on using Jikes, changed conf/web.xml JSPServlet to refer people to Jasper-HowTo so that we don't have these instructions in two places. (yoavs) + /update +/changelog + /subsection +/section + section name=Tomcat 5.5.5 (yoavs) subsection name=General changelog 1.24 +3 -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.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- jasper-howto.xml 22 Oct 2004 17:13:26 - 1.23 +++ jasper-howto.xml 3 Dec 2004 15:17:34 - 1.24 @@ -281,7 +281,9 @@ a href=http://oss.software.ibm.com/developerworks/opensource/jikes/; Jikes/a to compile JSP pages: ul -liDownload and install the Ant JAR in code$CATALINA_BASE/common/lib/code./li +liFrom your a href=ant.apache.orgAnt/a installation, copy ant.jar +and (if it's available: Ant 1.5 and later) ant-launcher.jar to +code$CATALINA_BASE/common/lib/code./li liDownload and install jikes. jikes must support the -encoding option. Execute codejikes -help/code to verify that it was built with support for code-encoding/code./li - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jasper-howto.xml
remm2004/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 ChangesPath 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 - 1.1 +++ LocalStrings.properties 4 Oct 2004 17:39:45 - 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 - 1.13 +++ EmbeddedServletOptions.java 4 Oct 2004 17:39:45 - 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 - 1.24 +++ Options.java 4 Oct 2004 17:39:45 - 1.25 @@ -164,4 +164,10 @@ * Are Text strings to be generated as char arrays? */ public boolean genStringAsCharArray(); + +/** + * Modification test interval. + */ +public int getModificationTestInterval();
Re: cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jasper-howto.xml
Hi Remy, [EMAIL PROTECTED] wrote: remm2004/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. how is this different from the 'checkInterval' option? Jan Revision ChangesPath 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 - 1.1 +++ LocalStrings.properties 4 Oct 2004 17:39:45 - 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 - 1.13 +++ EmbeddedServletOptions.java 4 Oct 2004 17:39:45 - 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 - 1.24 +++ Options.java 4 Oct 2004 17:39:45 - 1.25 @@ -164,4 +164,10 @@ * Are Text strings to be generated as char arrays? */ public boolean genStringAsCharArray(); + +/** + * Modification test interval. + */ +public int
Re: cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jasper-howto.xml
Jan Luehe wrote: Hi Remy, [EMAIL PROTECTED] wrote: remm2004/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. how is this different from the 'checkInterval' option? The check interval is in seconds, and is for the background reloading thread. This means at most one check every X ms. I did consider reusing it, but since the unit was different, I chose not to. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jasper-howto.xml
Remy Maucherat wrote: Jan Luehe wrote: Hi Remy, [EMAIL PROTECTED] wrote: remm2004/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. how is this different from the 'checkInterval' option? The check interval is in seconds, and is for the background reloading thread. This means at most one check every X ms. I did consider reusing it, but since the unit was different, I chose not to. I think this new option is going to confuse users. If we wanted to reduce the number of last-modified checks in development mode, we should at least try to leverage the existing option and use the same unit. The default for the new option (4000ms) seems to imply that seconds may be a reasonable unit for it as well. Also, I think it is more intuitive if we check for last modification date on each access in dev mode. I don't think perf improvements are important in dev mode. +listrongmodificationTestInterval/strong - If development has to be set to +codetrue/code for any reason (such as dynamic generation of JSPs), setting +this to a high value will improve performance a lot./li Why won't dynamic generation of JSPs work in nondev mode? Notice that in JspServleWrapper, we compile if options.getDevelopment() || firstTime Jan Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jasper-howto.xml
Jan Luehe wrote: Remy Maucherat wrote: Jan Luehe wrote: Hi Remy, [EMAIL PROTECTED] wrote: remm2004/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. how is this different from the 'checkInterval' option? The check interval is in seconds, and is for the background reloading thread. This means at most one check every X ms. I did consider reusing it, but since the unit was different, I chose not to. I think this new option is going to confuse users. If we wanted to reduce the number of last-modified checks in development mode, we should at least try to leverage the existing option and use the same unit. The default for the new option (4000ms) seems to imply that seconds may be a reasonable unit for it as well. Also, I think it is more intuitive if we check for last modification date on each access in dev mode. I don't think perf improvements are important in dev mode. I feel strongly about this. Dev mode is the default, and is needed for some special purpose stuff (where JSPs are regenerated on the fly), so it need to perform relatively well. IMO, the background reloading thread is way too complex and buggy. It should go in favor of a much simpler mechanism (if you really want only one thing; personally, I would keep both, as it's more flexible). +listrongmodificationTestInterval/strong - If development has to be set to +codetrue/code for any reason (such as dynamic generation of JSPs), setting +this to a high value will improve performance a lot./li Why won't dynamic generation of JSPs work in nondev mode? Notice that in JspServleWrapper, we compile if options.getDevelopment() || firstTime It works for the first compilation, of course. But most people who use that obvious refresh their JSPs. Overall, I think that having two attributes is appropriate. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/webapps/docs changelog.xml jasper-howto.xml
I feel strongly about this. Dev mode is the default, and is needed for some special purpose stuff (where JSPs are regenerated on the fly), so it need to perform relatively well. IMO, the background reloading thread is way too complex and buggy. It should go in favor of a much simpler mechanism (if you really want only one thing; personally, I would keep both, as it's more flexible). +listrongmodificationTestInterval/strong - If development has to be set to +codetrue/code for any reason (such as dynamic generation of JSPs), setting +this to a high value will improve performance a lot./li Why won't dynamic generation of JSPs work in nondev mode? Notice that in JspServleWrapper, we compile if options.getDevelopment() || firstTime It works for the first compilation, of course. But most people who use that obvious refresh their JSPs. Overall, I think that having two attributes is appropriate. OK, I think I've bought your point. Can we specify the interval in seconds then, or what was the reason to specify it in ms? Do you think a JSP could change that frequently? When you specify a value 1000ms, you might as well specify -1. Also, we should add this option to the documentation of the JspServlet init params in the default web.xml. Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]