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:34:49 UTC

[tomcat] branch 9.0.x updated (db393fb -> 3f9391a)

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

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


    from db393fb  Remove unnecessary code
     new c04c7b4  Remove unnecessary code
     new 7c5ed67  Allow use of jsp-file without JSP based servlet being loaded at startup
     new 7d29bbb  Don't load jsp-file based servlets on test webapp start
     new 3f9391a  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] 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 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 3f9391ae035ee9eac76b026b371832d3d41581ef
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 abbe594..17ef82f 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -1872,8 +1872,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


[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 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 7c5ed67af524a1ec5df4718575a1e567894a2134
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 9b9cf1c..f631aca 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 b754fa1..244aa7c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -130,6 +130,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 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit c04c7b462170f7518b09588a9ad45e1bf7e53434
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 627e72e..abbe594 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -1868,7 +1868,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] 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 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 7d29bbbb3e07fe07d32abb4985085de0ce49de87
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 5797ee1..d5f5bee 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