diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype.properties
index f9c2bb3adc9c..29f5cccaa076 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=Disable compilation of JSPs at runtime.
extendedDocumentRoot.name=Extended document root
extendedDocumentRoot=Directory that the JSP engine will search for additional JSP files to serve.
+javaSourceLevel.name=Java source level
+javaSourceLevel=Default Java source level for JSPs compiled by the JSP engine.
+
jdkSourceLevel.name=JDK source level
jdkSourceLevel=Default Java source level for JSPs compiled by the JSP engine.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_cs.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_cs.properties
index 7d1bc20fc8b5..a3c49484a142 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_cs.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_cs.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=Zak\u00e1zat kompilaci str\u00e1nek JSP za b\u011bh
extendedDocumentRoot.name=Ko\u0159enov\u00fd adres\u00e1\u0159 roz\u0161\u00ed\u0159en\u00fdch dokument\u016f
extendedDocumentRoot=Adres\u00e1\u0159, ve kter\u00e9m bude stroj str\u00e1nek JSP hledat dal\u0161\u00ed soubory JSP pro poskytov\u00e1n\u00ed.
+javaSourceLevel.name=\u00darove\u0148 zdroje sady Java
+javaSourceLevel=V\u00fdchoz\u00ed \u00farove\u0148 zdroje Java pro str\u00e1nky JSP kompilovan\u00e9 strojem JSP.
+
jdkSourceLevel.name=\u00darove\u0148 zdroje sady JDK
jdkSourceLevel=V\u00fdchoz\u00ed \u00farove\u0148 zdroje Java pro str\u00e1nky JSP kompilovan\u00e9 strojem JSP.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_de.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_de.properties
index 052963c8ad0f..995df32f871b 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_de.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_de.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=Inaktiviert die Kompilierung von JSPs zur Laufzeit.
extendedDocumentRoot.name=Erweitertes Dokumentstammverzeichnis
extendedDocumentRoot=Verzeichnis, das die JSP-Engine nach weiteren bereitzustellenden JSP-Dateien durchsucht.
+javaSourceLevel.name=Java-Quellenebene
+javaSourceLevel=Java-Standardquellenebene f\u00fcr JSPs, die von der JSP-Engine kompiliert werden.
+
jdkSourceLevel.name=JDK-Quellenebene
jdkSourceLevel=Java-Standardquellenebene f\u00fcr JSPs, die von der JSP-Engine kompiliert werden.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_es.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_es.properties
index e3695f15da1a..808918f7c27a 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_es.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_es.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=Inhabilitar la compilaci\u00f3n de JSP en tiempo de
extendedDocumentRoot.name=Ra\u00edz de documento ampliada
extendedDocumentRoot=Directorio en el que el motor JSP buscar\u00e1 archivos JSP adicionales que servir.
+javaSourceLevel.name=Nivel de origen Java
+javaourceLevel=Nivel de origen de Java por omisi\u00f3n para los JSP compilados por el motor JSP.
+
jdkSourceLevel.name=Nivel de origen JDK
jdkSourceLevel=Nivel de origen de Java por omisi\u00f3n para los JSP compilados por el motor JSP.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_fr.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_fr.properties
index 831d0dcb27bd..70f6ed7ea100 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_fr.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_fr.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=D\u00e9sactiver la compilation des fichiers JSP \u0
extendedDocumentRoot.name=R\u00e9pertoire de documents \u00e9tendu
extendedDocumentRoot=R\u00e9pertoire dans lequel le moteur JSP recherche les fichiers JSP suppl\u00e9mentaires \u00e0 servir.
+javaSourceLevel.name=Niveau source du Java
+javaSourceLevel=Niveau source Java par d\u00e9faut des fichiers JSP compil\u00e9s par le moteur JSP.
+
jdkSourceLevel.name=Niveau source du JDK
jdkSourceLevel=Niveau source Java par d\u00e9faut des fichiers JSP compil\u00e9s par le moteur JSP.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_hu.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_hu.properties
index d0aa09841a58..6502f69a83dc 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_hu.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_hu.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=JSP f\u00e1jlok gy\u0171jtem\u00e9ny\u00e9nek tilt\
extendedDocumentRoot.name=Kiterjesztett dokumentumgy\u00f6k\u00e9r
extendedDocumentRoot=A k\u00f6nyvt\u00e1r, amelyben a JSP alrendszer tov\u00e1bbi kiszolg\u00e1land\u00f3 JSP f\u00e1jlokat keres.
+javaSourceLevel.name=Java forr\u00e1sszint
+javaSourceLevel=Az alap\u00e9rtelmezett Java forr\u00e1sszint a JSP alrendszer \u00e1ltal ford\u00edtott JSP f\u00e1jlokhoz.
+
jdkSourceLevel.name=JDK forr\u00e1sszint
jdkSourceLevel=Az alap\u00e9rtelmezett Java forr\u00e1sszint a JSP alrendszer \u00e1ltal ford\u00edtott JSP f\u00e1jlokhoz.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_it.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_it.properties
index fb9bd5488444..7097e0d9c33a 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_it.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_it.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=Disabilita compilazione di JSP al runtime.
extendedDocumentRoot.name=Root esteso del documento
extendedDocumentRoot=La directory in cui il motore JSP ricercher\u00e0 ulteriori file JSP da servire.
+javaSourceLevel.name=Livello origine Java
+javaSourceLevel=Il livello di origine Java predefinito per i JSP compilati dal motore JSP.
+
jdkSourceLevel.name=Livello origine JDK
jdkSourceLevel=Il livello di origine Java predefinito per i JSP compilati dal motore JSP.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ja.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ja.properties
index 29e8a3a578b8..c3ac15adee92 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ja.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ja.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=\u5b9f\u884c\u6642\u306b JSP \u306e\u30b3\u30f3\u30
extendedDocumentRoot.name=\u62e1\u5f35\u6587\u66f8\u30eb\u30fc\u30c8
extendedDocumentRoot=JSP \u30a8\u30f3\u30b8\u30f3\u304c\u51e6\u7406\u5bfe\u8c61\u306e\u8ffd\u52a0\u306e JSP \u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fc\u3002
+javaSourceLevel.name=Java \u30bd\u30fc\u30b9\u30fb\u30ec\u30d9\u30eb
+javaSourceLevel=JSP \u30a8\u30f3\u30b8\u30f3\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b JSP \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e Java \u30bd\u30fc\u30b9\u30fb\u30ec\u30d9\u30eb\u3002
+
jdkSourceLevel.name=JDK \u30bd\u30fc\u30b9\u30fb\u30ec\u30d9\u30eb
jdkSourceLevel=JSP \u30a8\u30f3\u30b8\u30f3\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b JSP \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306e Java \u30bd\u30fc\u30b9\u30fb\u30ec\u30d9\u30eb\u3002
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ko.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ko.properties
index 4f62a034dc19..64f73c9a092b 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ko.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ko.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=\ub7f0\ud0c0\uc784 \uc2dc JSP\uc758 \ucef4\ud30c\uc
extendedDocumentRoot.name=\ud655\uc7a5 \ubb38\uc11c \ub8e8\ud2b8
extendedDocumentRoot=JSP \uc5d4\uc9c4\uc774 \uc11c\ube44\uc2a4\ud560 \ucd94\uac00 JSP \ud30c\uc77c\uc744 \uac80\uc0c9\ud560 \ub514\ub809\ud1a0\ub9ac\uc785\ub2c8\ub2e4.
+javaSourceLevel.name=Java \uc18c\uc2a4 \ub808\ubca8
+javaSourceLevel=JSP \uc5d4\uc9c4\uc774 \ucef4\ud30c\uc77c\ud558\ub294 JSP\uc5d0 \ub300\ud55c \uae30\ubcf8 Java \uc18c\uc2a4 \ub808\ubca8\uc785\ub2c8\ub2e4.
+
jdkSourceLevel.name=JDK \uc18c\uc2a4 \ub808\ubca8
jdkSourceLevel=JSP \uc5d4\uc9c4\uc774 \ucef4\ud30c\uc77c\ud558\ub294 JSP\uc5d0 \ub300\ud55c \uae30\ubcf8 Java \uc18c\uc2a4 \ub808\ubca8\uc785\ub2c8\ub2e4.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_pl.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_pl.properties
index 3294f54d569e..d8e2412fa3c0 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_pl.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_pl.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=Wy\u0142\u0105cz kompilacj\u0119 stron JSP w czasie
extendedDocumentRoot.name=Rozszerzony katalog g\u0142\u00f3wny dokument\u00f3w
extendedDocumentRoot=Katalog, w kt\u00f3rym mechanizm JSP b\u0119dzie wyszukiwa\u0142 dodatkowych plik\u00f3w JSP do udost\u0119pnienia.
+javaSourceLevel.name=Poziom \u017ar\u00f3d\u0142a Java
+javaSourceLevel=Domy\u015blny poziom \u017ar\u00f3d\u0142a Java dla stron JSP kompilowanych przez mechanizm JSP.
+
jdkSourceLevel.name=Poziom \u017ar\u00f3d\u0142a JDK
jdkSourceLevel=Domy\u015blny poziom \u017ar\u00f3d\u0142a Java dla stron JSP kompilowanych przez mechanizm JSP.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_pt_BR.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_pt_BR.properties
index fbf40462be6b..bf8f8d81278c 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_pt_BR.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_pt_BR.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=Desativar compila\u00e7\u00e3o de JSPs no tempo de
extendedDocumentRoot.name=Raiz do Documento Estendido
extendedDocumentRoot=Diret\u00f3rio no qual o mecanismo JSP procurar\u00e1 arquivos JSP adicionais para atender.
+javaSourceLevel.name=N\u00edvel de Origem de Java
+javaSourceLevel=N\u00edvel de origem Java padr\u00e3o para JSPs compiladas pelo mecanismo JSP.
+
jdkSourceLevel.name=N\u00edvel de Origem de JDK
jdkSourceLevel=N\u00edvel de origem Java padr\u00e3o para JSPs compiladas pelo mecanismo JSP.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ro.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ro.properties
index 6cde233f9d82..fe07de4f7a70 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ro.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ro.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=Dezactivare compilare a JSP-urilor la runtime.
extendedDocumentRoot.name=R\u0103d\u0103cin\u0103 document extins\u0103
extendedDocumentRoot=Directorul \u00een care va c\u0103uta motorul JSP pentru fi\u015fiere JSP suplimentare pentru serviree.
+javaSourceLevel.name=Nivel surs\u0103 Java
+javaSourceLevel=Nivel surs\u0103 Java implicit pentru JSP-urile compilate de motorul JSP.
+
jdkSourceLevel.name=Nivel surs\u0103 JDK
jdkSourceLevel=Nivel surs\u0103 Java implicit pentru JSP-urile compilate de motorul JSP.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ru.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ru.properties
index 39295fd9b92b..57f3e2161130 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ru.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_ru.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=\u0412\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u0
extendedDocumentRoot.name=\u041a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432
extendedDocumentRoot=\u041a\u0430\u0442\u0430\u043b\u043e\u0433, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u044c JSP \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 JSP \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.
+javaSourceLevel.name=\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 Java
+javaSourceLevel=\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 Java \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f JSP, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u043c JSP.
+
jdkSourceLevel.name=\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 JDK
jdkSourceLevel=\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 Java \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f JSP, \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u043c JSP.
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_zh.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_zh.properties
index f8ffcb2adc19..9f0820f8b641 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_zh.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_zh.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=\u5728\u8fd0\u884c\u65f6\u7981\u7528 JSP \u7684\u7f
extendedDocumentRoot.name=\u6269\u5c55\u6587\u6863\u6839
extendedDocumentRoot=JSP \u5f15\u64ce\u5c06\u5728\u5176\u4e2d\u641c\u7d22\u8981\u4f7f\u7528\u7684\u989d\u5916 JSP \u6587\u4ef6\u7684\u76ee\u5f55\u3002
+javaSourceLevel.name=Java \u6e90\u7ea7\u522b
+javaSourceLevel=JSP \u5f15\u64ce\u7f16\u8bd1\u7684 JSP \u7684\u7f3a\u7701 Java \u6e90\u7ea7\u522b\u3002
+
jdkSourceLevel.name=JDK \u6e90\u7ea7\u522b
jdkSourceLevel=JSP \u5f15\u64ce\u7f16\u8bd1\u7684 JSP \u7684\u7f3a\u7701 Java \u6e90\u7ea7\u522b\u3002
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_zh_TW.properties b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_zh_TW.properties
index 6b3d93e15c51..5eed0de3db5c 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_zh_TW.properties
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/l10n/metatype_zh_TW.properties
@@ -25,6 +25,9 @@ disableJspRuntimeCompilation=\u5728\u57f7\u884c\u6642\u671f\u505c\u7528 JSP \u7d
extendedDocumentRoot.name=\u5ef6\u4f38\u6587\u4ef6\u6839\u76ee\u9304
extendedDocumentRoot=JSP \u5f15\u64ce\u6703\u5728\u5176\u4e2d\u641c\u5c0b\u8981\u63d0\u4f9b\u4e4b\u5176\u4ed6 JSP \u6a94\u7684\u76ee\u9304\u3002
+javaSourceLevel.name=Java \u4f86\u6e90\u5c64\u6b21
+javaSourceLevel=JSP \u5f15\u64ce\u6240\u7de8\u8b6f\u4e4b JSP \u7684\u9810\u8a2d Java \u4f86\u6e90\u5c64\u6b21\u3002
+
jdkSourceLevel.name=JDK \u4f86\u6e90\u5c64\u6b21
jdkSourceLevel=JSP \u5f15\u64ce\u6240\u7de8\u8b6f\u4e4b JSP \u7684\u9810\u8a2d Java \u4f86\u6e90\u5c64\u6b21\u3002
diff --git a/dev/com.ibm.ws.jsp/resources/OSGI-INF/metatype/metatype.xml b/dev/com.ibm.ws.jsp/resources/OSGI-INF/metatype/metatype.xml
index cf9e48d243ca..4e86850a2b0b 100644
--- a/dev/com.ibm.ws.jsp/resources/OSGI-INF/metatype/metatype.xml
+++ b/dev/com.ibm.ws.jsp/resources/OSGI-INF/metatype/metatype.xml
@@ -20,6 +20,22 @@
id="disableJspRuntimeCompilation" required="false" type="Boolean" default="false"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/JspOptions.java b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/JspOptions.java
index 4e0341e46669..fbc762e457f0 100644
--- a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/JspOptions.java
+++ b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/JspOptions.java
@@ -54,7 +54,8 @@ public class JspOptions {
protected String ieClassId = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
protected boolean isZOS = false;
protected String javaEncoding = "UTF-8";
- private int jdkSourceLevel;
+ private int jdkSourceLevel = -1;
+ private int javaSourceLevel = -1;
protected String jspCompileClasspath = null;
protected boolean keepGenerated = false;
protected boolean keepGeneratedclassfiles = true;
@@ -126,7 +127,7 @@ public JspOptions(Properties jspParams) {
populateOptions(jspParams);
}
- public void populateOptions(Properties jspParams) {
+ public void populateOptions(Properties jspParams) {
/*--------------------*/
/* Load Option Values */
@@ -222,7 +223,9 @@ else if (useJikesCompiler.equalsIgnoreCase("false"))
}
int useJdkSourceLevel = -1;
+ int useJavaSourceLevel = -1;
String rawJdkSourceLevel = jspParams.getProperty("jdkSourceLevel");
+ String rawJavaSourceLevel = jspParams.getProperty("javaSourceLevel");
try {
if (rawJdkSourceLevel != null)
useJdkSourceLevel = Integer.parseInt(rawJdkSourceLevel);
@@ -235,6 +238,17 @@ else if (useJikesCompiler.equalsIgnoreCase("false"))
logger.logp(Level.INFO, CLASS_NAME, "populateOptions", JspMessages.getMessage("jsp.jdksourcelevel.value", new Object[] { useJdkSourceLevel })); //152472
setJdkSourceLevel(useJdkSourceLevel);
}
+ if (rawJavaSourceLevel != null && rawJavaSourceLevel.equals("1.8")) // only for Java 8 do we accept 1.8
+ rawJavaSourceLevel = "8";
+ try {
+ if (rawJavaSourceLevel != null)
+ useJavaSourceLevel = Integer.parseInt(rawJavaSourceLevel);
+ } catch(NumberFormatException e) {
+ if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.INFO)) {
+ logger.logp(Level.INFO, CLASS_NAME, "populateOptions", "Invalid value for javaSourceLevel = " + rawJavaSourceLevel + ".");
+ }
+ }
+ setJavaSourceLevel(useJavaSourceLevel);
// Normalize compileWithAssert and jdkSourceLevel; compileWithAssert with value true means compile with
// jdk 1.4 source level. Only jdkSourceLevel will be used elsewhere in the JSP container.
@@ -1072,9 +1086,26 @@ public void setJdkSourceLevel(int jdkSourceLevel) {
this.jdkSourceLevel = jdkSourceLevel;
}
+ public void setJavaSourceLevel(int javaSourceLevel) {
+ int jmv = JavaInfo.majorVersion();
+ if (javaSourceLevel > jmv) {
+ // can not specify higher than running Java
+ if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.INFO)) {
+ logger.logp(Level.INFO, CLASS_NAME, "setJavaSourceLevel", "Requested javaSourceLevel=" + javaSourceLevel +
+ " exceeds installed Java " + jmv + ", therefore forcing to " + jmv);
+ }
+ javaSourceLevel = jmv;
+ }
+ this.javaSourceLevel = javaSourceLevel;
+ }
+
public int getJdkSourceLevel() {
return jdkSourceLevel;
}
+
+ public int getJavaSourceLevel() {
+ return javaSourceLevel;
+ }
public void setVerbose(boolean verbose) {
this.verbose = verbose;
@@ -1628,6 +1659,7 @@ public String toString() { //overrride Object's toString to assist in debugging.
"ieClassId = [" + ieClassId +"]"+separatorString+
"isZOS = [" + isZOS +"]"+separatorString+
"javaEncoding = [" + javaEncoding +"]"+separatorString+
+ "javaSourceLevel = [" + javaSourceLevel +"]"+separatorString+
"jdkSourceLevel = [" + jdkSourceLevel +"]"+separatorString+
"jspCompileClasspath = [" + tmpJspCompileClasspath +"]"+separatorString+
"keepGenerated = [" + keepGenerated +"]"+separatorString+
diff --git a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/inmemory/compiler/InMemoryJDTCompiler.java b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/inmemory/compiler/InMemoryJDTCompiler.java
index f731a8802815..bcd27bbbd50c 100644
--- a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/inmemory/compiler/InMemoryJDTCompiler.java
+++ b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/inmemory/compiler/InMemoryJDTCompiler.java
@@ -67,6 +67,7 @@ public class InMemoryJDTCompiler implements JspCompiler {
private boolean isVerbose = false;
private boolean isDeprecation = false;
private int jdkSourceLevel;
+ private Integer javaSourceLevel;
private boolean useFullPackageNames = false;
public InMemoryJDTCompiler(ClassLoader loader, JspOptions options) {
@@ -78,6 +79,7 @@ public InMemoryJDTCompiler(ClassLoader loader, JspOptions options) {
isVerbose = options.isVerbose();
isDeprecation = options.isDeprecation();
jdkSourceLevel = options.getJdkSourceLevel();
+ javaSourceLevel = options.getJavaSourceLevel();
useFullPackageNames = options.isUseFullPackageNames();
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable(Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME, "InMemoryJDTCompiler", "Entering InMemoryJDTCompiler.");
@@ -87,7 +89,11 @@ public InMemoryJDTCompiler(ClassLoader loader, JspOptions options) {
logger.logp(Level.FINE, CLASS_NAME, "InMemoryJDTCompiler", "isDebugEnabled: ["+isDebugEnabled+"]");
logger.logp(Level.FINE, CLASS_NAME, "InMemoryJDTCompiler", "isVerbose: ["+isVerbose+"]");
logger.logp(Level.FINE, CLASS_NAME, "InMemoryJDTCompiler", "isDeprecation: ["+isDeprecation+"]");
- logger.logp(Level.FINE, CLASS_NAME, "InMemoryJDTCompiler", "jdkSourceLevel: ["+jdkSourceLevel+"]");
+ if (javaSourceLevel == -1) {
+ logger.logp(Level.FINE, CLASS_NAME, "InMemoryJDTCompiler", "jdkSourceLevel: ["+jdkSourceLevel+"]");
+ } else {
+ logger.logp(Level.FINE, CLASS_NAME, "InMemoryJDTCompiler", "javaSourceLevel: ["+javaSourceLevel+"]");
+ }
logger.logp(Level.FINE, CLASS_NAME, "InMemoryJDTCompiler", "useFullPackageNames: ["+useFullPackageNames+"]");
}
}
@@ -123,8 +129,12 @@ public JspCompilerResult compile(JspResources[] jspResources, JspResources[] dep
}
compilerOptionsMap.put(CompilerOptions.OPTION_Encoding, javaEncoding);
- //487396.1 jdkSourceLevel is 15 by default now ... should get into if statement
- if (jdkSourceLevel == 14) {
+ if (javaSourceLevel != -1) {
+ compilerOptionsMap.put(CompilerOptions.OPTION_Source, javaSourceLevel.toString());
+ compilerOptionsMap.put(CompilerOptions.OPTION_Compliance, javaSourceLevel.toString());
+ compilerOptionsMap.put(CompilerOptions.OPTION_TargetPlatform, javaSourceLevel.toString());
+ }
+ else if (jdkSourceLevel == 14) {
compilerOptionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
compilerOptionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4); //PM32704
compilerOptionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); //PM32704
diff --git a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tools/AbstractJspModC.java b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tools/AbstractJspModC.java
index 51be7e0bcac4..ecd965e1a860 100644
--- a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tools/AbstractJspModC.java
+++ b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tools/AbstractJspModC.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1997, 2004 IBM Corporation and others.
+ * Copyright (c) 1997, 2021 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -277,6 +277,17 @@ private int _internalCompileApp(boolean doTraceCheck) throws JspCoreException {
if (booleanProperty != null) {
options.setUseJikes(booleanProperty.booleanValue());
}
+ String javaSourceLevel = (String) this.optionOverrides.get(JspToolsOptionKey.javaSourceLevelKey);
+ int javaLevel = -1;
+ if (javaSourceLevel != null) {
+ if (javaSourceLevel.equals("1.8")) javaSourceLevel="8";
+ try {
+ javaLevel = Integer.parseInt(javaSourceLevel);
+ } catch (NumberFormatException e) {
+
+ }
+ options.setJavaSourceLevel(javaLevel);
+ }
// Normalize compileWithAssert and jdkSourceLevel; compileWithAssert with value true means compile with
// jdk 1.4 source level. Only jdkSourceLevel will be used elsewhere in the JSP container.
Boolean assertProperty = (Boolean) this.optionOverrides.get(JspToolsOptionKey.compileWithAssertKey);
diff --git a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/JDTCompiler.java b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/JDTCompiler.java
index 6c5d9c6d5b92..91ca0de4aebb 100644
--- a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/JDTCompiler.java
+++ b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/JDTCompiler.java
@@ -71,18 +71,20 @@ public class JDTCompiler implements JspCompiler {
private boolean isVerbose = false;
private boolean isDeprecation = false;
private int jdkSourceLevel;
+ private Integer javaSourceLevel;
private boolean useFullPackageNames = false;
public JDTCompiler(ClassLoader loader, JspOptions options) {
this.loader = loader;
javaEncoding = options.getJavaEncoding();
outputDir = options.getOutputDir().getPath();
- isClassDebugInfo = options.isClassDebugInfo();
- isDebugEnabled = options.isDebugEnabled();
- isVerbose = options.isVerbose();
- isDeprecation = options.isDeprecation();
- jdkSourceLevel = options.getJdkSourceLevel();
- useFullPackageNames = options.isUseFullPackageNames();
+ isClassDebugInfo = options.isClassDebugInfo();
+ isDebugEnabled = options.isDebugEnabled();
+ isVerbose = options.isVerbose();
+ isDeprecation = options.isDeprecation();
+ jdkSourceLevel = options.getJdkSourceLevel();
+ javaSourceLevel = options.getJavaSourceLevel();
+ useFullPackageNames = options.isUseFullPackageNames();
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable(Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME, "JDTCompiler", "Entering JDTCompiler.");
}
@@ -112,8 +114,12 @@ public JspCompilerResult compile(JspResources[] jspResources, JspResources[] dep
}
compilerOptionsMap.put(CompilerOptions.OPTION_Encoding, javaEncoding);
- //487396.1 jdkSourceLevel is 15 by default now ... should get into if statement
- if (jdkSourceLevel == 14) {
+ if (javaSourceLevel != -1) {
+ compilerOptionsMap.put(CompilerOptions.OPTION_Source, javaSourceLevel.toString());
+ compilerOptionsMap.put(CompilerOptions.OPTION_Compliance, javaSourceLevel.toString());
+ compilerOptionsMap.put(CompilerOptions.OPTION_TargetPlatform, javaSourceLevel.toString());
+ }
+ else if (jdkSourceLevel == 14) {
compilerOptionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
compilerOptionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4); //PM32704
compilerOptionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_4); //PM32704
@@ -125,20 +131,20 @@ else if (jdkSourceLevel == 15) {
}
//PM04610 start
else if (jdkSourceLevel == 16) {
- compilerOptionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
+ compilerOptionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
compilerOptionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6); // 341708
compilerOptionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6); // 412312
}
//PM04610 end
else if (jdkSourceLevel == 17) {
- compilerOptionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
- compilerOptionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
+ compilerOptionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
+ compilerOptionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_7);
compilerOptionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7);
}
//126902 start
else if (jdkSourceLevel == 18) {
- compilerOptionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8);
- compilerOptionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8);
+ compilerOptionsMap.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8);
+ compilerOptionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8);
compilerOptionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8);
}
//126902 end
diff --git a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/JikesJspCompiler.java b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/JikesJspCompiler.java
index 1a600e55b23f..da95be81781b 100644
--- a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/JikesJspCompiler.java
+++ b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/JikesJspCompiler.java
@@ -52,6 +52,7 @@ public class JikesJspCompiler implements JspCompiler {
protected boolean isVerbose = false;
protected boolean isDeprecation = false;
protected int jdkSourceLevel;
+ protected Integer javaSourceLevel;
protected boolean useOptimizedClasspath = false;
protected String absouluteContextRoot = null;
@@ -69,6 +70,7 @@ public JikesJspCompiler(String absouluteContextRoot, JspClassloaderContext class
this.isVerbose = options.isVerbose();
this.isDeprecation = options.isDeprecation();
jdkSourceLevel = options.getJdkSourceLevel();
+ javaSourceLevel = options.getJavaSourceLevel();
out = new CharArrayWriter();
}
@@ -200,9 +202,11 @@ private List buildArgList(String source, List compilerOptions, String classpath)
}
// Jikes must default to -source 1.3; override if jdkSourceLevel is set
- //487396.1 jdkSourceLevel is 15 by default now ... should get into if statement
argList.add("-source");
- if (jdkSourceLevel == 14) {
+ if (javaSourceLevel != -1) { // 7183
+ argList.add(javaSourceLevel.toString());
+ }
+ else if (jdkSourceLevel == 14) {
argList.add("1.4");
}
else if (jdkSourceLevel == 15) {
diff --git a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/StandardJspCompiler.java b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/StandardJspCompiler.java
index 6b9f7552cbb7..ec31dfa09a5c 100644
--- a/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/StandardJspCompiler.java
+++ b/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/compiler/StandardJspCompiler.java
@@ -53,7 +53,8 @@ public class StandardJspCompiler implements JspCompiler {
protected boolean isDebugEnabled = false;
protected boolean isVerbose = false;
protected boolean isDeprecation = false;
- protected int jdkSourceLevel;
+ protected int jdkSourceLevel;
+ protected Integer javaSourceLevel;
protected String javaEncoding = null;
protected String outputDir = null;
protected JavaCompiler compiler;
@@ -76,6 +77,7 @@ public StandardJspCompiler(JspClassloaderContext context, JspOptions options, St
this.isDeprecation = options.isDeprecation();
this.javaEncoding = options.getJavaEncoding();
this.jdkSourceLevel= options.getJdkSourceLevel();
+ this.javaSourceLevel = options.getJavaSourceLevel();
this.outputDir = options.getOutputDir().getPath();
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable(Level.FINE)) {
@@ -184,9 +186,12 @@ private List buildArgList(List compilerOptions, String outputDirectory)
argList.add("-deprecation");
}
- //487396.1 jdkSourceLevel is 15 by default now ... should get into if statement
argList.add("-source");
- if (jdkSourceLevel == 14) {
+ // issue 7183: look at javaSourceLevel first before using jdkSourceLevel
+ if (javaSourceLevel != -1) {
+ argList.add(javaSourceLevel.toString());
+ }
+ else if (jdkSourceLevel == 14) {
argList.add("1.4");
}
else if (jdkSourceLevel == 15) {
diff --git a/dev/com.ibm.ws.jsp/src/com/ibm/wsspi/jsp/tools/JspToolsOptionKey.java b/dev/com.ibm.ws.jsp/src/com/ibm/wsspi/jsp/tools/JspToolsOptionKey.java
index 9088c8cf46ce..b7cb3bc11984 100644
--- a/dev/com.ibm.ws.jsp/src/com/ibm/wsspi/jsp/tools/JspToolsOptionKey.java
+++ b/dev/com.ibm.ws.jsp/src/com/ibm/wsspi/jsp/tools/JspToolsOptionKey.java
@@ -55,6 +55,7 @@ public class JspToolsOptionKey {
private final static int DELETECLASSFILESBEFORERECOMPILE = 33; //PI12939
private static final int ALLOWMULTIPLEATTRIBUTEVALUES = 34; //PI30519
private final static int ALLOWPRECEDENDEINJSPEXPRESSIONSWITHCONSTANTSTRING = 35; //PI37304
+private final static int JAVASOURCELEVEL = 36; //issue 7183
public final static JspToolsOptionKey keepGeneratedKey=new JspToolsOptionKey(KEEPGENERATED);
public final static JspToolsOptionKey verboseKey=new JspToolsOptionKey(VERBOSE);
@@ -97,6 +98,7 @@ public class JspToolsOptionKey {
public final static JspToolsOptionKey deleteClassFilesBeforeRecompile=new JspToolsOptionKey(DELETECLASSFILESBEFORERECOMPILE); //PI12939
public final static JspToolsOptionKey allowMultipleAttributeValues=new JspToolsOptionKey(ALLOWMULTIPLEATTRIBUTEVALUES); //PI30519
public final static JspToolsOptionKey allowPrecedenceInJspExpressionsWithConstantString=new JspToolsOptionKey(ALLOWPRECEDENDEINJSPEXPRESSIONSWITHCONSTANTSTRING); //PI37304
+public final static JspToolsOptionKey javaSourceLevelKey=new JspToolsOptionKey(JAVASOURCELEVEL); //issue 7183
private int key=0;
/**
*
diff --git a/dev/fattest.simplicity/src/com/ibm/websphere/simplicity/config/JspEngineElement.java b/dev/fattest.simplicity/src/com/ibm/websphere/simplicity/config/JspEngineElement.java
index d6eea1eed612..e3c7a5ed782d 100644
--- a/dev/fattest.simplicity/src/com/ibm/websphere/simplicity/config/JspEngineElement.java
+++ b/dev/fattest.simplicity/src/com/ibm/websphere/simplicity/config/JspEngineElement.java
@@ -21,6 +21,7 @@ public class JspEngineElement extends ConfigElement {
private Boolean useStringCast;
private Boolean usescriptvardupinit;
private String jdkSourceLevel;
+ private String javaSourceLevel;
private Boolean disableResourceInjection;
private Boolean disableTldSearch;
private String scratchdir;
@@ -62,6 +63,18 @@ public void setJdkSourceLevel(String s) {
this.jdkSourceLevel = s;
}
+ /**
+ * @return the javaSourceLevel
+ */
+ public String getJavaSourceLevel() {
+ return javaSourceLevel;
+ }
+
+ @XmlAttribute(name = "javaSourceLevel")
+ public void setJavaSourceLevel(String s) {
+ this.javaSourceLevel = s;
+ }
+
/**
* @return the disableResourceInjection
*/
@@ -95,7 +108,7 @@ public void setScratchdir(String value) {
public String getScratchdir() {
return scratchdir;
}
-
+
/**
* @return the keepGenerated
*/
@@ -117,6 +130,8 @@ public String toString() {
buf.append("usescriptvardupinit=\"" + usescriptvardupinit + "\" ");
if (jdkSourceLevel != null)
buf.append("jdkSourceLevel=\"" + jdkSourceLevel + "\" ");
+ if (javaSourceLevel != null)
+ buf.append("javaSourceLevel=\"" + javaSourceLevel + "\" ");
if (disableResourceInjection != null)
buf.append("disableResourceInjection=\"" + disableResourceInjection + "\" ");
if (disableTldSearch != null)