diff --git a/Jenkinsfile b/Jenkinsfile index 10edbdbdc0..6197634b7d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { } tools { jdk 'jdk_1.7_latest' - maven 'maven_3_latest' + maven 'maven_3.8.7' } triggers { pollSCM 'H/15 * * * *' diff --git a/apps/pom.xml b/apps/pom.xml index c8104be666..23ea096cc8 100644 --- a/apps/pom.xml +++ b/apps/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-parent - 2.5.31 + 2.5.32 struts2-apps pom diff --git a/apps/rest-showcase/pom.xml b/apps/rest-showcase/pom.xml index ea071d1548..6f05bd2c11 100644 --- a/apps/rest-showcase/pom.xml +++ b/apps/rest-showcase/pom.xml @@ -24,12 +24,12 @@ org.apache.struts struts2-apps - 2.5.31 + 2.5.32 struts2-rest-showcase war - 2.5.31 + 2.5.32 Struts 2 Rest Showcase Webapp Struts 2 Rest Showcase Example diff --git a/apps/showcase/pom.xml b/apps/showcase/pom.xml index de37179a36..5fe2b04e9f 100644 --- a/apps/showcase/pom.xml +++ b/apps/showcase/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-apps - 2.5.31 + 2.5.32 struts2-showcase diff --git a/assembly/pom.xml b/assembly/pom.xml index bad2a2ce1d..e0e700fe07 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-parent - 2.5.31 + 2.5.32 struts2-assembly diff --git a/bom/pom.xml b/bom/pom.xml index 0aafe393da..074bb96d86 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -30,7 +30,7 @@ struts2-bom - 2.5.31 + 2.5.32 pom Struts 2 Bill of Materials @@ -45,7 +45,7 @@ - 2.5.31 + 2.5.32 true true @@ -181,7 +181,7 @@ - STRUTS_2_5_31 + STRUTS_2_5_32 scm:git:https://gitbox.apache.org/repos/asf/struts.git scm:git:https://gitbox.apache.org/repos/asf/struts.git https://github.com/apache/struts/ diff --git a/bundles/admin/pom.xml b/bundles/admin/pom.xml index 80bb51e6a4..48d2cf04f0 100644 --- a/bundles/admin/pom.xml +++ b/bundles/admin/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-osgi-bundles - 2.5.31 + 2.5.32 struts2-osgi-admin-bundle diff --git a/bundles/demo/pom.xml b/bundles/demo/pom.xml index 2ce9cc10b8..a589904550 100644 --- a/bundles/demo/pom.xml +++ b/bundles/demo/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-osgi-bundles - 2.5.31 + 2.5.32 struts2-osgi-demo-bundle diff --git a/bundles/pom.xml b/bundles/pom.xml index 9122ba34c2..6039545174 100755 --- a/bundles/pom.xml +++ b/bundles/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-parent - 2.5.31 + 2.5.32 struts2-osgi-bundles diff --git a/core/pom.xml b/core/pom.xml index 827b0d244f..8c9b0caab1 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-parent - 2.5.31 + 2.5.32 struts2-core jar diff --git a/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java b/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java index 5b03a262ea..408bcb0d50 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java @@ -35,7 +35,13 @@ import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; /** * Multipart form data request adapter for Jakarta Commons Fileupload package. @@ -64,7 +70,7 @@ public void parse(HttpServletRequest request, String saveDir) { } catch (FileUploadException e) { LOG.warn("Request exceeded size limit!", e); LocalizedMessage errorMessage; - if(e instanceof FileUploadBase.SizeLimitExceededException) { + if (e instanceof FileUploadBase.SizeLimitExceededException) { FileUploadBase.SizeLimitExceededException ex = (FileUploadBase.SizeLimitExceededException) e; errorMessage = buildErrorMessage(e, new Object[]{ex.getPermittedSize(), ex.getActualSize()}); } else { @@ -100,7 +106,7 @@ protected void processFileField(FileItem item) { LOG.debug("Item is a file upload"); // Skip file uploads that don't have a file name - meaning that no file was selected. - if (item.getName() == null || item.getName().trim().length() < 1) { + if (item.getName() == null || item.getName().trim().isEmpty()) { LOG.debug("No file has been uploaded for the field: {}", item.getFieldName()); return; } @@ -117,39 +123,42 @@ protected void processFileField(FileItem item) { } protected void processNormalFormField(FileItem item, String charset) throws UnsupportedEncodingException { - LOG.debug("Item is a normal form field"); + try { + LOG.debug("Item is a normal form field"); - List values; - if (params.get(item.getFieldName()) != null) { - values = params.get(item.getFieldName()); - } else { - values = new ArrayList<>(); - } + List values; + if (params.get(item.getFieldName()) != null) { + values = params.get(item.getFieldName()); + } else { + values = new ArrayList<>(); + } - long size = item.getSize(); - if (size == 0) { - values.add(StringUtils.EMPTY); - } else if (size > maxStringLength) { - String errorKey = "struts.messages.upload.error.parameter.too.long"; - LocalizedMessage localizedMessage = new LocalizedMessage(this.getClass(), errorKey, null, - new Object[] { item.getFieldName(), maxStringLength, size }); + long size = item.getSize(); + if (size == 0) { + values.add(StringUtils.EMPTY); + } else if (size > maxStringLength) { + String errorKey = "struts.messages.upload.error.parameter.too.long"; + LocalizedMessage localizedMessage = new LocalizedMessage(this.getClass(), errorKey, null, + new Object[]{item.getFieldName(), maxStringLength, size}); - if (!errors.contains(localizedMessage)) { - errors.add(localizedMessage); - } - return; + if (!errors.contains(localizedMessage)) { + errors.add(localizedMessage); + } + return; - } else if (charset != null) { - values.add(item.getString(charset)); - } else { - // note: see http://jira.opensymphony.com/browse/WW-633 - // basically, in some cases the charset may be null, so - // we're just going to try to "other" method (no idea if this - // will work) - values.add(item.getString()); + } else if (charset != null) { + values.add(item.getString(charset)); + } else { + // note: see https://issues.apache.org/jira/browse/WW-633 + // basically, in some cases the charset may be null, so + // we're just going to try to "other" method (no idea if this + // will work) + values.add(item.getString()); + } + params.put(item.getFieldName(), values); + } finally { + item.delete(); } - params.put(item.getFieldName(), values); - item.delete(); } protected List parseRequest(HttpServletRequest servletRequest, String saveDir) throws FileUploadException { @@ -323,14 +332,14 @@ public InputStream getInputStream() throws IOException { } /* (non-Javadoc) - * @see org.apache.struts2.dispatcher.multipart.MultiPartRequest#cleanUp() - */ + * @see org.apache.struts2.dispatcher.multipart.MultiPartRequest#cleanUp() + */ public void cleanUp() { Set names = files.keySet(); for (String name : names) { List items = files.get(name); for (FileItem item : items) { - LOG.debug("Removing file {} {}", name, item ); + LOG.debug("Removing file {} {}", name, item); if (!item.isInMemory()) { item.delete(); } diff --git a/plugins/bean-validation/pom.xml b/plugins/bean-validation/pom.xml index 434bb2681b..9d6dc4c4c9 100644 --- a/plugins/bean-validation/pom.xml +++ b/plugins/bean-validation/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 4.0.0 diff --git a/plugins/cdi/pom.xml b/plugins/cdi/pom.xml index 55a352b8c6..68d0c54d6c 100644 --- a/plugins/cdi/pom.xml +++ b/plugins/cdi/pom.xml @@ -25,7 +25,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-cdi-plugin diff --git a/plugins/config-browser/pom.xml b/plugins/config-browser/pom.xml index 07637bcbdf..48f84811c4 100644 --- a/plugins/config-browser/pom.xml +++ b/plugins/config-browser/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-config-browser-plugin diff --git a/plugins/convention/pom.xml b/plugins/convention/pom.xml index 7eaff285c5..db65215329 100644 --- a/plugins/convention/pom.xml +++ b/plugins/convention/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-convention-plugin diff --git a/plugins/dwr/pom.xml b/plugins/dwr/pom.xml index 92877711e6..562aa1b0c8 100644 --- a/plugins/dwr/pom.xml +++ b/plugins/dwr/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-dwr-plugin diff --git a/plugins/embeddedjsp/pom.xml b/plugins/embeddedjsp/pom.xml index 1105900680..e70fb1a24b 100644 --- a/plugins/embeddedjsp/pom.xml +++ b/plugins/embeddedjsp/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-embeddedjsp-plugin diff --git a/plugins/gxp/pom.xml b/plugins/gxp/pom.xml index 799cf32cb6..300319073c 100644 --- a/plugins/gxp/pom.xml +++ b/plugins/gxp/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-gxp-plugin diff --git a/plugins/jasperreports/pom.xml b/plugins/jasperreports/pom.xml index 0b7d1467eb..ac27c56db2 100644 --- a/plugins/jasperreports/pom.xml +++ b/plugins/jasperreports/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-jasperreports-plugin diff --git a/plugins/javatemplates/pom.xml b/plugins/javatemplates/pom.xml index 5024df4a76..615133832c 100644 --- a/plugins/javatemplates/pom.xml +++ b/plugins/javatemplates/pom.xml @@ -25,7 +25,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-javatemplates-plugin diff --git a/plugins/jfreechart/pom.xml b/plugins/jfreechart/pom.xml index 45d706ac40..073ce018e3 100644 --- a/plugins/jfreechart/pom.xml +++ b/plugins/jfreechart/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-jfreechart-plugin diff --git a/plugins/json/pom.xml b/plugins/json/pom.xml index 8995d0c42d..fc16dbb7f2 100644 --- a/plugins/json/pom.xml +++ b/plugins/json/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-json-plugin diff --git a/plugins/junit/pom.xml b/plugins/junit/pom.xml index 7b2bc82f83..6cb13e564f 100644 --- a/plugins/junit/pom.xml +++ b/plugins/junit/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-junit-plugin diff --git a/plugins/osgi/pom.xml b/plugins/osgi/pom.xml index 50e4af79e2..71540c64a3 100644 --- a/plugins/osgi/pom.xml +++ b/plugins/osgi/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-osgi-plugin diff --git a/plugins/oval/pom.xml b/plugins/oval/pom.xml index c9a3d19d9a..8cdf897630 100644 --- a/plugins/oval/pom.xml +++ b/plugins/oval/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-oval-plugin diff --git a/plugins/pell-multipart/pom.xml b/plugins/pell-multipart/pom.xml index 00e3f0a1e3..12083213a0 100644 --- a/plugins/pell-multipart/pom.xml +++ b/plugins/pell-multipart/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-pell-multipart-plugin diff --git a/plugins/plexus/pom.xml b/plugins/plexus/pom.xml index 37e41468cd..90cb3a8542 100644 --- a/plugins/plexus/pom.xml +++ b/plugins/plexus/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-plexus-plugin diff --git a/plugins/pom.xml b/plugins/pom.xml index ed1cfa68c7..f632afd2ce 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-parent - 2.5.31 + 2.5.32 struts2-plugins diff --git a/plugins/portlet-tiles/pom.xml b/plugins/portlet-tiles/pom.xml index eea101e096..96bbd79848 100644 --- a/plugins/portlet-tiles/pom.xml +++ b/plugins/portlet-tiles/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-portlet-tiles-plugin diff --git a/plugins/portlet/pom.xml b/plugins/portlet/pom.xml index c4d4379c8e..fa4b4a6c71 100644 --- a/plugins/portlet/pom.xml +++ b/plugins/portlet/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-portlet-plugin diff --git a/plugins/rest/pom.xml b/plugins/rest/pom.xml index dad9e2d0ff..772473e582 100644 --- a/plugins/rest/pom.xml +++ b/plugins/rest/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-rest-plugin diff --git a/plugins/sitegraph/pom.xml b/plugins/sitegraph/pom.xml index f58fc415d5..dc5a98f68c 100644 --- a/plugins/sitegraph/pom.xml +++ b/plugins/sitegraph/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-sitegraph-plugin diff --git a/plugins/sitemesh/pom.xml b/plugins/sitemesh/pom.xml index 82c845cf73..8d0e67af23 100644 --- a/plugins/sitemesh/pom.xml +++ b/plugins/sitemesh/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-sitemesh-plugin diff --git a/plugins/spring/pom.xml b/plugins/spring/pom.xml index 999e2f6cc8..55421a212f 100644 --- a/plugins/spring/pom.xml +++ b/plugins/spring/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-spring-plugin diff --git a/plugins/testng/pom.xml b/plugins/testng/pom.xml index 281815a408..dbeee74802 100644 --- a/plugins/testng/pom.xml +++ b/plugins/testng/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-testng-plugin diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml index 42ed29fffd..c797d2e032 100644 --- a/plugins/tiles/pom.xml +++ b/plugins/tiles/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts2-plugins - 2.5.31 + 2.5.32 struts2-tiles-plugin diff --git a/pom.xml b/pom.xml index 74c002c8c7..67822f786b 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 4.0.0 struts2-parent - 2.5.31 + 2.5.32 pom Struts 2 http://struts.apache.org/ @@ -51,7 +51,7 @@ scm:git:https://gitbox.apache.org/repos/asf/struts.git scm:git:https://gitbox.apache.org/repos/asf/struts.git https://github.com/apache/struts/ - STRUTS_2_5_31 + STRUTS_2_5_32 @@ -96,7 +96,7 @@ UTF-8 - 2023-06-13T08:01:38Z + 2023-09-11T06:13:26Z 3.1.29