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 2020/02/06 12:06:40 UTC

[tomcat] 01/03: Parameterize JSP spec version in localization messages to ease re-use

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 64d64800f978a0e5bdb15f4e3cf27565b10cc7a2
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Feb 6 10:01:47 2020 +0000

    Parameterize JSP spec version in localization messages to ease re-use
---
 java/org/apache/jasper/Constants.java                       | 2 ++
 java/org/apache/jasper/resources/LocalStrings.properties    | 2 +-
 java/org/apache/jasper/resources/LocalStrings_es.properties | 2 +-
 java/org/apache/jasper/resources/LocalStrings_fr.properties | 2 +-
 java/org/apache/jasper/resources/LocalStrings_ja.properties | 2 +-
 java/org/apache/jasper/resources/LocalStrings_ko.properties | 2 +-
 java/org/apache/jasper/runtime/HttpJspBase.java             | 3 ++-
 java/org/apache/jasper/runtime/JspFactoryImpl.java          | 3 +--
 webapps/docs/changelog.xml                                  | 8 ++++++++
 9 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/jasper/Constants.java b/java/org/apache/jasper/Constants.java
index ebb5fa0..14fc618 100644
--- a/java/org/apache/jasper/Constants.java
+++ b/java/org/apache/jasper/Constants.java
@@ -30,6 +30,8 @@ import java.util.List;
  */
 public class Constants {
 
+    public static final String SPEC_VERSION = "2.3";
+
     /**
      * The base class of the generated servlets.
      */
diff --git a/java/org/apache/jasper/resources/LocalStrings.properties b/java/org/apache/jasper/resources/LocalStrings.properties
index 929bb6a..598f32f 100644
--- a/java/org/apache/jasper/resources/LocalStrings.properties
+++ b/java/org/apache/jasper/resources/LocalStrings.properties
@@ -15,7 +15,7 @@
 
 jasper.error.emptybodycontent.nonempty=According to TLD, tag [{0}] must be empty, but is not
 
-jsp.engine.info=Jasper JSP 2.3 Engine
+jsp.engine.info=Jasper JSP {0} Engine
 jsp.error.action.isnottagfile=[{0}] action can be used in tag files only
 jsp.error.action.istagfile=[{0}] action cannot be used in a tag file
 jsp.error.attempt_to_clear_flushed_buffer=Error: Attempt to clear a buffer that's already been flushed
diff --git a/java/org/apache/jasper/resources/LocalStrings_es.properties b/java/org/apache/jasper/resources/LocalStrings_es.properties
index 41dda9b..584772d 100644
--- a/java/org/apache/jasper/resources/LocalStrings_es.properties
+++ b/java/org/apache/jasper/resources/LocalStrings_es.properties
@@ -15,7 +15,7 @@
 
 jasper.error.emptybodycontent.nonempty=Según el TLD, el tag [{0}] debe de estar vacío, pero no lo está
 
-jsp.engine.info=Motor Jasper JSP 2.3
+jsp.engine.info=Motor Jasper JSP {0}
 jsp.error.action.isnottagfile=La acción [{0}] sólo se puede usar en archivos tag
 jsp.error.action.istagfile=La acción [{0}] no se puede usar en un archivo tag
 jsp.error.attempt_to_clear_flushed_buffer=Error: Se ha intentado limpiar un buffer que ya había sido escrito
diff --git a/java/org/apache/jasper/resources/LocalStrings_fr.properties b/java/org/apache/jasper/resources/LocalStrings_fr.properties
index 5010b4b..0c58724 100644
--- a/java/org/apache/jasper/resources/LocalStrings_fr.properties
+++ b/java/org/apache/jasper/resources/LocalStrings_fr.properties
@@ -15,7 +15,7 @@
 
 jasper.error.emptybodycontent.nonempty=D''après la TLD, le tag [{0}] doit être vide, mais ne l''est pas
 
-jsp.engine.info=Moteur Jasper JSP 2.3
+jsp.engine.info=Moteur Jasper JSP {0}
 jsp.error.action.isnottagfile=L''action [{0}] ne peut être utilisée que dans un fichier tag
 jsp.error.action.istagfile=L''action [{0}] ne peut être utilisée dans un fichier tag
 jsp.error.attempt_to_clear_flushed_buffer=Erreur: Tentative d'effacement d'un tampon qui a déjà été vidangé (flush)
diff --git a/java/org/apache/jasper/resources/LocalStrings_ja.properties b/java/org/apache/jasper/resources/LocalStrings_ja.properties
index 7a10510..4427ff6 100644
--- a/java/org/apache/jasper/resources/LocalStrings_ja.properties
+++ b/java/org/apache/jasper/resources/LocalStrings_ja.properties
@@ -15,7 +15,7 @@
 
 jasper.error.emptybodycontent.nonempty=TLDに従ってタグ [{0}] は空でなければいけませんが、そうではありません
 
-jsp.engine.info=Jasper JSP 2.3エンジン
+jsp.engine.info=Jasper JSP {0}エンジン
 jsp.error.action.isnottagfile=[{0}] アクションはタグファイル中でのみ使用できません
 jsp.error.action.istagfile=[{0}] アクションはタグファイル中で使用できません
 jsp.error.attempt_to_clear_flushed_buffer=エラー: 既にフラッシュされているバッファをクリアしようとしました
diff --git a/java/org/apache/jasper/resources/LocalStrings_ko.properties b/java/org/apache/jasper/resources/LocalStrings_ko.properties
index 4361c42..5bc96e6 100644
--- a/java/org/apache/jasper/resources/LocalStrings_ko.properties
+++ b/java/org/apache/jasper/resources/LocalStrings_ko.properties
@@ -15,7 +15,7 @@
 
 jasper.error.emptybodycontent.nonempty=TLD 파일에 따르면, [{0}] 태그는 반드시 비어 있어야 하는데, 그렇지 않습니다,
 
-jsp.engine.info=Jasper JSP 2.3 엔진
+jsp.engine.info=Jasper JSP {0} 엔진
 jsp.error.action.isnottagfile=[{0}] 액션은 오직 태그 파일들 내에서만 사용될 수 있습니다.
 jsp.error.action.istagfile=[{0}] 액션은 태그 파일 내에서 사용될 수 없습니다.
 jsp.error.attempt_to_clear_flushed_buffer=오류: 이미 배출되어 버린 버퍼를 폐기하려는 시도
diff --git a/java/org/apache/jasper/runtime/HttpJspBase.java b/java/org/apache/jasper/runtime/HttpJspBase.java
index 544af4e..d508e99 100644
--- a/java/org/apache/jasper/runtime/HttpJspBase.java
+++ b/java/org/apache/jasper/runtime/HttpJspBase.java
@@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.HttpJspPage;
 
+import org.apache.jasper.Constants;
 import org.apache.jasper.compiler.Localizer;
 
 /**
@@ -51,7 +52,7 @@ public abstract class HttpJspBase extends HttpServlet implements HttpJspPage {
 
     @Override
     public String getServletInfo() {
-        return Localizer.getMessage("jsp.engine.info");
+        return Localizer.getMessage("jsp.engine.info", Constants.SPEC_VERSION);
     }
 
     @Override
diff --git a/java/org/apache/jasper/runtime/JspFactoryImpl.java b/java/org/apache/jasper/runtime/JspFactoryImpl.java
index c2a73d4..7f05c82 100644
--- a/java/org/apache/jasper/runtime/JspFactoryImpl.java
+++ b/java/org/apache/jasper/runtime/JspFactoryImpl.java
@@ -38,7 +38,6 @@ import org.apache.jasper.Constants;
  */
 public class JspFactoryImpl extends JspFactory {
 
-    private static final String SPEC_VERSION = "2.3";
     private static final boolean USE_POOL =
         Boolean.parseBoolean(System.getProperty("org.apache.jasper.runtime.JspFactoryImpl.USE_POOL", "true"));
     private static final int POOL_SIZE =
@@ -81,7 +80,7 @@ public class JspFactoryImpl extends JspFactory {
         return new JspEngineInfo() {
             @Override
             public String getSpecificationVersion() {
-                return SPEC_VERSION;
+                return Constants.SPEC_VERSION;
             }
         };
     }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 545fb3c..0a2d245 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -45,6 +45,14 @@
   issues do not "pop up" wrt. others).
 -->
 <section name="Tomcat 8.5.52 (markt)" rtext="in development">
+  <subsection name="Jasper">
+    <changelog>
+      <scode>
+        Parameterize JSP version in localization messages to allow simpler
+        re-use between major versions. (markt)
+      </scode>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 8.5.51 (markt)" rtext="release in progress">
   <subsection name="Catalina">


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