diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c3464f762..11e27f287 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -52,12 +52,12 @@ jobs: java-version: 17 cache: 'maven' - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/scorecards-analysis.yaml b/.github/workflows/scorecards-analysis.yaml index d6992e44a..180cd9712 100644 --- a/.github/workflows/scorecards-analysis.yaml +++ b/.github/workflows/scorecards-analysis.yaml @@ -58,13 +58,13 @@ jobs: publish_results: true - name: "Upload artifact" - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # 3.1.3 + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # 4.0.0 with: name: SARIF file path: results.sarif retention-days: 5 - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@b398f525a5587552e573b247ac661067fafa920b # 2.1.22 + uses: github/codeql-action/upload-sarif@03e7845b7bfcd5e7fb63d1ae8c61b0e791134fab # 2.22.11 with: sarif_file: results.sarif diff --git a/apps/showcase/src/main/webapp/WEB-INF/decorators/main.jsp b/apps/showcase/src/main/webapp/WEB-INF/decorators/main.jsp index 34f732db3..9003e52ed 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/decorators/main.jsp +++ b/apps/showcase/src/main/webapp/WEB-INF/decorators/main.jsp @@ -72,7 +72,7 @@ - + $(function () { var alerts = $('ul.alert').wrap('
'); alerts.prepend('×'); diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp index 3064aa251..cf8fddaeb 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp +++ b/apps/showcase/src/main/webapp/WEB-INF/validation/ajaxFormSubmit.jsp @@ -72,7 +72,7 @@
- + /******************************************************************** * JS just used on this page. * Usually this would be placed in a JS file diff --git a/assembly/src/main/resources/template.vm b/assembly/src/main/resources/template.vm index e254e59a0..07189c060 100644 --- a/assembly/src/main/resources/template.vm +++ b/assembly/src/main/resources/template.vm @@ -1,6 +1,6 @@ #set ($stylebase = "https://struts.apache.org/css") - @@ -43,12 +43,12 @@ under the License. #end - #end - + ${debugHtml?no_esc} diff --git a/core/src/main/resources/org/apache/struts2/interceptor/debugging/console.ftl b/core/src/main/resources/org/apache/struts2/interceptor/debugging/console.ftl index 4aaccaa01..520a8add1 100644 --- a/core/src/main/resources/org/apache/struts2/interceptor/debugging/console.ftl +++ b/core/src/main/resources/org/apache/struts2/interceptor/debugging/console.ftl @@ -21,7 +21,7 @@ - <@s.script type="text/javascript"> + <@s.script> var baseUrl = "<@s.url value="/static" includeParams="none"/>"; window.open(baseUrl+"/webconsole.html", 'OGNL Console','width=500,height=450,status=no,toolbar=no,menubar=no'); diff --git a/core/src/main/resources/struts-beans.xml b/core/src/main/resources/struts-beans.xml index 1238c9e05..754bccd07 100644 --- a/core/src/main/resources/struts-beans.xml +++ b/core/src/main/resources/struts-beans.xml @@ -174,11 +174,19 @@ - + + + + - diff --git a/core/src/main/resources/template/css_xhtml/form-validate.ftl b/core/src/main/resources/template/css_xhtml/form-validate.ftl index da7b24080..8d46b594d 100644 --- a/core/src/main/resources/template/css_xhtml/form-validate.ftl +++ b/core/src/main/resources/template/css_xhtml/form-validate.ftl @@ -19,7 +19,7 @@ */ --> <#if parameters.validate!false == true> - +<@s.script src="${base}${parameters.staticContentPath}/css_xhtml/validation.js"/> <#if parameters.onsubmit??> ${tag.addParameter('onsubmit', "${parameters.onsubmit}; return validateForm_${parameters.escapedId}();")} <#else> diff --git a/core/src/main/resources/template/simple/combobox.ftl b/core/src/main/resources/template/simple/combobox.ftl index 1cef11754..733e33c5f 100644 --- a/core/src/main/resources/template/simple/combobox.ftl +++ b/core/src/main/resources/template/simple/combobox.ftl @@ -18,7 +18,7 @@ * under the License. */ --> -<@s.script type="text/javascript"> +<@s.script> function autoPopulate_${parameters.escapedId}(targetElement) { <#if parameters.headerKey?? && parameters.headerValue??> if (targetElement.options[targetElement.selectedIndex].value == '${parameters.headerKey?js_string}') { diff --git a/core/src/main/resources/template/simple/doubleselect.ftl b/core/src/main/resources/template/simple/doubleselect.ftl index 2a87e30f5..a0c5cf82d 100644 --- a/core/src/main/resources/template/simple/doubleselect.ftl +++ b/core/src/main/resources/template/simple/doubleselect.ftl @@ -114,7 +114,7 @@ /><#rt/> -<@s.script type="text/javascript"> +<@s.script> <#assign itemCount = startCount/> var ${parameters.escapedId}Group = new Array(${parameters.listSize?number?c} + ${startCount}); for (var i = 0; i < (${parameters.listSize?number?c} + ${startCount}); i++) { diff --git a/core/src/main/resources/template/simple/form-close-tooltips.ftl b/core/src/main/resources/template/simple/form-close-tooltips.ftl index 1a418b985..6007081c4 100644 --- a/core/src/main/resources/template/simple/form-close-tooltips.ftl +++ b/core/src/main/resources/template/simple/form-close-tooltips.ftl @@ -24,6 +24,6 @@ --><#t/> <#if (parameters.hasTooltip!false)><#t/> <#lt/> - <#lt/><@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/domTT.js" /> + <#lt/><@s.script src="${base}${parameters.staticContentPath}/domTT.js" /> <#lt/><@s.link rel="stylesheet" type="text/css" href="${base}${parameters.staticContentPath}/domTT.css" /> <#t/> diff --git a/core/src/main/resources/template/simple/form-close.ftl b/core/src/main/resources/template/simple/form-close.ftl index ce2b91259..f8bb047d6 100644 --- a/core/src/main/resources/template/simple/form-close.ftl +++ b/core/src/main/resources/template/simple/form-close.ftl @@ -21,7 +21,7 @@ <#if (parameters.customOnsubmitEnabled??)> -<@s.script type="text/javascript"> +<@s.script> <#-- Enable auto-select of optiontransferselect tag's entries upon containing form's submission. diff --git a/core/src/main/resources/template/simple/head.ftl b/core/src/main/resources/template/simple/head.ftl index 82fe8db20..623ec70f2 100644 --- a/core/src/main/resources/template/simple/head.ftl +++ b/core/src/main/resources/template/simple/head.ftl @@ -18,4 +18,4 @@ * under the License. */ --> -<@s.script src="${base}${parameters.staticContentPath}/utils.js" type="text/javascript" /> +<@s.script src="${base}${parameters.staticContentPath}/utils.js" /> diff --git a/core/src/main/resources/template/simple/inputtransferselect.ftl b/core/src/main/resources/template/simple/inputtransferselect.ftl index 9b28a02ce..117390ea7 100644 --- a/core/src/main/resources/template/simple/inputtransferselect.ftl +++ b/core/src/main/resources/template/simple/inputtransferselect.ftl @@ -19,7 +19,7 @@ */ --> <#if !stack.findValue("#inputtransferselect_js_included")??><#t/> - <@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/inputtransferselect.js"/> + <@s.script src="${base}${parameters.staticContentPath}/inputtransferselect.js"/> <#assign temporaryVariable = stack.setValue("#inputtransferselect_js_included", "true") /><#t/> <#t/> diff --git a/core/src/main/resources/template/simple/optiontransferselect.ftl b/core/src/main/resources/template/simple/optiontransferselect.ftl index adf770499..408196e0d 100644 --- a/core/src/main/resources/template/simple/optiontransferselect.ftl +++ b/core/src/main/resources/template/simple/optiontransferselect.ftl @@ -19,7 +19,7 @@ */ --> <#if !stack.findValue("#optiontransferselect_js_included")??><#t/> - <@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/optiontransferselect.js" /> + <@s.script src="${base}${parameters.staticContentPath}/optiontransferselect.js" /> <#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/> <#t/>
diff --git a/core/src/main/resources/template/simple/updownselect.ftl b/core/src/main/resources/template/simple/updownselect.ftl index 7491f9a08..a67194f63 100644 --- a/core/src/main/resources/template/simple/updownselect.ftl +++ b/core/src/main/resources/template/simple/updownselect.ftl @@ -19,7 +19,7 @@ */ --> <#if !stack.findValue("#optiontransferselect_js_included")??><#t/> - <@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/optiontransferselect.js" /><#t/> + <@s.script src="${base}${parameters.staticContentPath}/optiontransferselect.js" /><#t/> <#assign temporaryVariable = stack.setValue("#optiontransferselect_js_included", "true") /><#t/> <#t/>
diff --git a/core/src/main/resources/template/xhtml/form-close-validate.ftl b/core/src/main/resources/template/xhtml/form-close-validate.ftl index dfc338cbc..dce718e6c 100644 --- a/core/src/main/resources/template/xhtml/form-close-validate.ftl +++ b/core/src/main/resources/template/xhtml/form-close-validate.ftl @@ -32,7 +32,7 @@ Only the following validators are supported: END SNIPPET: supported-validators --> <#if ((parameters.validate!false == true) && (parameters.performValidation!false == true))> -<@s.script type="text/javascript"> +<@s.script> function validateForm_${parameters.escapedId}() { <#-- In case of multiselect fields return only the first value. diff --git a/core/src/main/resources/template/xhtml/form-close.ftl b/core/src/main/resources/template/xhtml/form-close.ftl index 300de7a04..1d17228b7 100644 --- a/core/src/main/resources/template/xhtml/form-close.ftl +++ b/core/src/main/resources/template/xhtml/form-close.ftl @@ -22,7 +22,7 @@ <#include "/${parameters.templateDir}/simple/form-close.ftl" /> <#include "/${parameters.templateDir}/${parameters.expandTheme}/form-close-validate.ftl" /> <#if parameters.focusElement??> -<@s.script type="text/javascript"> +<@s.script> StrutsUtils.addOnLoad(function() { var element = document.getElementById("${parameters.focusElement?js_string}"); if(element) { diff --git a/core/src/main/resources/template/xhtml/form-validate.ftl b/core/src/main/resources/template/xhtml/form-validate.ftl index 028c5d9ec..ffd811610 100644 --- a/core/src/main/resources/template/xhtml/form-validate.ftl +++ b/core/src/main/resources/template/xhtml/form-validate.ftl @@ -19,7 +19,7 @@ */ --> <#if parameters.validate!false == true> - <@s.script type="text/javascript" src="${base}${parameters.staticContentPath}/xhtml/validation.js" /> + <@s.script src="${base}${parameters.staticContentPath}/xhtml/validation.js" /> <#if parameters.onsubmit??> ${tag.addParameter('onsubmit', "${parameters.onsubmit}; return validateForm_${parameters.escapedId}();")} <#else> diff --git a/core/src/site/confluence/ww-template-autoexport.html b/core/src/site/confluence/ww-template-autoexport.html index 0d0c24ff1..dc9424dc8 100644 --- a/core/src/site/confluence/ww-template-autoexport.html +++ b/core/src/site/confluence/ww-template-autoexport.html @@ -49,7 +49,7 @@ under the License. color: #666; } - +
-
+
-
+
-
+
-
+
- +
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/inputtransferselect-2.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/inputtransferselect-2.txt index 9c11a87b4..6260cc68c 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/inputtransferselect-2.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/inputtransferselect-2.txt @@ -1,7 +1,7 @@
- + diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-1.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-1.txt index f16886524..c94d40565 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-1.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-1.txt @@ -1,7 +1,7 @@ - - + + + diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-2.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-2.txt index 359475c64..1939871cb 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-2.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-2.txt @@ -1,7 +1,7 @@ - +
- + +
@@ -24,15 +24,15 @@



+ value="All Right" onclick="moveAllOptions(document.getElementById('id'), document.getElementById('doubleId'), false, 'Header Key', '');" />



-

-
-
- + +
@@ -25,14 +25,14 @@



+ value="All Right" onclick="moveAllOptions(document.getElementById('id'), document.getElementById('doubleId'), false, 'Header Key', '');" />




-
- + + - + +
@@ -24,15 +24,15 @@



+ value="All Right" onclick="moveAllOptions(document.getElementById('id'), document.getElementById('doubleId'), false, '');" />




-
- +
@@ -25,15 +25,15 @@



+ value="All Right" onclick="moveAllOptions(document.getElementById('id'), document.getElementById('doubleId'), false, 'Header Key', '');" />




- - +
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-5.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-5.txt index fb0c97934..2cdccaefe 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-5.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/optiontransferselect-5.txt @@ -1,7 +1,7 @@ -
- + +
@@ -24,15 +24,15 @@



+ value="All Right" onclick="moveAllOptions(document.getElementById('id'), document.getElementById('doubleId'), false, 'Header Key', '');" />




-
- + +
@@ -25,15 +25,15 @@



+ value="All Right" onclick="moveAllOptions(document.getElementById('id'), document.getElementById('doubleId'), false, 'Header Key', '');" />




-
- + +
@@ -22,12 +22,12 @@ value="Left" onclick="moveSelectedOptions(document.getElementById('doubleId'), document.getElementById('id'), false, 'Double Header Key', '');alert('Moving Left');" />



-

-
- +
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-1.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-1.txt index d34b31d2d..e80e91683 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-1.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-1.txt @@ -15,7 +15,7 @@
- + diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-2.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-2.txt index e04c68858..13b40700a 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-2.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-2.txt @@ -15,5 +15,5 @@
- + diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-3.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-3.txt index a70521455..5c891772d 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-3.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/tooltip-3.txt @@ -16,6 +16,6 @@ - + diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/updownselecttag-1.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/updownselecttag-1.txt index 3d3542779..eb86508da 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/updownselecttag-1.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/updownselecttag-1.txt @@ -1,5 +1,5 @@
- + diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/updownselecttag-11.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/updownselecttag-11.txt index 3f68bc62e..943766ef6 100644 --- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/updownselecttag-11.txt +++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/updownselecttag-11.txt @@ -1,5 +1,5 @@
- +
-    -    -    +    +    +   
- +
- +
- +
- +
- +
- +
- +
- +
- +