You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/04/20 07:35:19 UTC

[tomcat] branch 8.5.x updated (646b807 -> 99dd5ec)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from 646b807  Remove unnecessary code
     new c006217  Remove unnecessary code
     new e5c25b0  Allow use of jsp-file without JSP based servlet being loaded at startup
     new d5db73f  Don't load jsp-file based servlets on test webapp start
     new 99dd5ec  Remove unnecessary code

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/catalina/core/StandardWrapper.java | 2 +-
 java/org/apache/jasper/compiler/Generator.java     | 9 ++++++---
 test/webapp/WEB-INF/web.xml                        | 1 +
 webapps/docs/changelog.xml                         | 8 ++++++++
 4 files changed, 16 insertions(+), 4 deletions(-)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 03/04: Don't load jsp-file based servlets on test webapp start

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit d5db73faf7215a10b26b75b5a30e68069e0e8e66
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Apr 19 20:35:52 2021 +0100

    Don't load jsp-file based servlets on test webapp start
---
 test/webapp/WEB-INF/web.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test/webapp/WEB-INF/web.xml b/test/webapp/WEB-INF/web.xml
index ff01151..7da3ee9 100644
--- a/test/webapp/WEB-INF/web.xml
+++ b/test/webapp/WEB-INF/web.xml
@@ -153,6 +153,7 @@
   <servlet>
     <servlet-name>Bug53574</servlet-name>
     <jsp-file>/WEB-INF/jsp/bug53574.jsp</jsp-file>
+    <load-on-startup>-2</load-on-startup>
   </servlet>
   <servlet-mapping>
     <servlet-name>Bug53574</servlet-name>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/04: Allow use of jsp-file without JSP based servlet being loaded at startup

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit e5c25b096f13728feb00a132b073659b1d17e7ca
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Apr 19 20:34:39 2021 +0100

    Allow use of jsp-file without JSP based servlet being loaded at startup
    
    This is particularly useful in unit tests as west/webapp is laoded many
    times and loaded the jsp-file based servlets every time has a measurable
    performance impact (adds ~10% in my local tests)
---
 java/org/apache/catalina/core/StandardWrapper.java | 2 +-
 webapps/docs/changelog.xml                         | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java
index d233568..aa04b8a 100644
--- a/java/org/apache/catalina/core/StandardWrapper.java
+++ b/java/org/apache/catalina/core/StandardWrapper.java
@@ -335,7 +335,7 @@ public class StandardWrapper extends ContainerBase
     @Override
     public int getLoadOnStartup() {
 
-        if (isJspServlet && loadOnStartup < 0) {
+        if (isJspServlet && loadOnStartup == -1) {
             /*
              * JspServlet must always be preloaded, because its instance is
              * used during registerJMX (when registering the JSP
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index fd6ebd7..d248431 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -126,6 +126,14 @@
         Review code used to generate Java source from JSPs and tags and remove
         code found to be unnecessary. (markt)
       </scode>
+      <update>
+        <code>&lt;servlet&gt;</code> entries in web.xml that include a
+        <code>&lt;jsp-file&gt;</code> element and a negative
+        <code>&lt;load-no-startup&gt;</code> element that is not the default
+        value of <code>-1</code> will no longer be loaded at start-up. This
+        makes it possible to define a <code>&lt;jsp-file&gt;</code> that will
+        not be loaded at start-up. (markt)
+      </update>
     </changelog>
   </subsection>
   <subsection name="Web applications">

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/04: Remove unnecessary code

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit c006217b0618dabee2a89b4b3f57ade50336a337
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Apr 19 18:09:59 2021 +0100

    Remove unnecessary code
---
 java/org/apache/jasper/compiler/Generator.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java
index 27a8326..22346a3 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -1851,7 +1851,9 @@ class Generator {
             // Add the named objects to the list of 'introduced' names to enable
             // a later test as per JSP.5.3
             VariableInfo[] infos = n.getVariableInfos();
-            if (infos != null && infos.length > 0) {
+            // The Validator always calls setTagData() which ensures infos is
+            // non-null
+            if (infos.length > 0) {
                 for (VariableInfo info : infos) {
                     if (info != null && info.getVarName() != null)
                         pageInfo.getVarInfoNames().add(info.getVarName());

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 04/04: Remove unnecessary code

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 99dd5ecff3b46340b9578ce1ea6cf01165b1cb3c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Apr 19 20:38:44 2021 +0100

    Remove unnecessary code
---
 java/org/apache/jasper/compiler/Generator.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java
index 22346a3..b3e177c 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -1855,8 +1855,9 @@ class Generator {
             // non-null
             if (infos.length > 0) {
                 for (VariableInfo info : infos) {
-                    if (info != null && info.getVarName() != null)
-                        pageInfo.getVarInfoNames().add(info.getVarName());
+                    // A null variable name will trigger multiple compilation
+                    // failures so assume non-null here
+                    pageInfo.getVarInfoNames().add(info.getVarName());
                 }
             }
             TagVariableInfo[] tagInfos = n.getTagVariableInfos();

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org