diff --git a/sitemesh3/pom.xml b/sitemesh3/pom.xml
index 5e553931..e07af914 100644
--- a/sitemesh3/pom.xml
+++ b/sitemesh3/pom.xml
@@ -14,7 +14,13 @@
war
+
+
+ 7.0.3
@@ -35,21 +41,6 @@
log4j-slf4j-impl
${log4j2.version}
-
-
- org.apache.struts
- struts2-junit-plugin
- ${struts2.version}
- test
-
-
-
- junit
- junit
- 4.13.2
- test
-
-
diff --git a/sitemesh3/src/main/java/org/apache/struts/examples/sitemesh3/UploadAction.java b/sitemesh3/src/main/java/org/apache/struts/examples/sitemesh3/UploadAction.java
new file mode 100644
index 00000000..c2b3f85a
--- /dev/null
+++ b/sitemesh3/src/main/java/org/apache/struts/examples/sitemesh3/UploadAction.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.struts.examples.sitemesh3;
+
+import org.apache.struts2.ActionSupport;
+import org.apache.struts2.action.UploadedFilesAware;
+import org.apache.struts2.dispatcher.multipart.UploadedFile;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * Allows upload a file
+ */
+public class UploadAction extends ActionSupport implements UploadedFilesAware {
+
+ private File[] upload;
+ private String[] uploadFileName;
+ private String[] uploadContentType;
+
+ public String execute() throws Exception {
+ return INPUT;
+ }
+
+ public File[] getUpload() {
+ return upload;
+ }
+
+ public String[] getUploadFileName() {
+ return uploadFileName;
+ }
+
+ public String[] getUploadContentType() {
+ return uploadContentType;
+ }
+
+ @Override
+ public void withUploadedFiles(List uploadedFiles) {
+ upload = uploadedFiles.stream().map(UploadedFile::getContent).toArray(File[]::new);
+ uploadFileName = uploadedFiles.stream().map(UploadedFile::getName).toArray(String[]::new);
+ uploadContentType = uploadedFiles.stream().map(UploadedFile::getContentType).toArray(String[]::new);
+ }
+}
diff --git a/sitemesh3/src/main/resources/log4j2.xml b/sitemesh3/src/main/resources/log4j2.xml
index 1f4e3df4..9793da52 100644
--- a/sitemesh3/src/main/resources/log4j2.xml
+++ b/sitemesh3/src/main/resources/log4j2.xml
@@ -2,13 +2,13 @@
-
+
-
+
diff --git a/sitemesh3/src/main/resources/struts.xml b/sitemesh3/src/main/resources/struts.xml
index 7048cff6..875a3dbb 100644
--- a/sitemesh3/src/main/resources/struts.xml
+++ b/sitemesh3/src/main/resources/struts.xml
@@ -20,6 +20,9 @@
/WEB-INF/error.jsp
+
+ /WEB-INF/upload.jsp
+
diff --git a/sitemesh3/src/main/webapp/WEB-INF/admin/hello.jsp b/sitemesh3/src/main/webapp/WEB-INF/admin/hello.jsp
index b3e711e3..c1ded3a4 100644
--- a/sitemesh3/src/main/webapp/WEB-INF/admin/hello.jsp
+++ b/sitemesh3/src/main/webapp/WEB-INF/admin/hello.jsp
@@ -6,9 +6,10 @@
SiteMesh example: Admin Index with Default Decorator
-
+
Hello
+Admin Index