From 2d814395533d2af1e429748b7446ce9b624f8513 Mon Sep 17 00:00:00 2001 From: JCgH4164838Gh792C124B5 <43964333+JCgH4164838Gh792C124B5@users.noreply.github.com> Date: Mon, 11 Feb 2019 19:26:43 -0500 Subject: [PATCH] Minor config fixes for the Showcase Application in 2.5.x: 1) Token examples. Examples 2 and 3 previously resulted in 403's upon submit (config issue). 2) Token examples. Example 4 resulted in error 500 when selected from the menu (FTL param type issue). 3) Validation examples. Examples quizBasic, quizClient and quizClientCss resulted in 404's when selected from menu (config issue). 4) File upload examples. Multiple file upload missing result page (list and array), added missing JSP. Added missing input results in configuration. 5) Add manual test for public constant access via expression (to If tag JSP). Similar to PR#255 for 2.6.x. --- .../src/main/resources/struts-fileupload.xml | 2 + .../src/main/resources/struts-token.xml | 4 +- .../src/main/resources/struts-validation.xml | 18 ++--- .../WEB-INF/fileupload/multiple-success.jsp | 65 +++++++++++++++++++ .../WEB-INF/tags/non-ui/ifTag/testIf.jsp | 14 ++++ .../main/webapp/WEB-INF/token/example4.ftl | 2 +- 6 files changed, 93 insertions(+), 12 deletions(-) create mode 100644 apps/showcase/src/main/webapp/WEB-INF/fileupload/multiple-success.jsp diff --git a/apps/showcase/src/main/resources/struts-fileupload.xml b/apps/showcase/src/main/resources/struts-fileupload.xml index a13739aa5..33be370ba 100644 --- a/apps/showcase/src/main/resources/struts-fileupload.xml +++ b/apps/showcase/src/main/resources/struts-fileupload.xml @@ -40,6 +40,7 @@ + /WEB-INF/fileupload/multipleUploadUsingList.jsp /WEB-INF/fileupload/multiple-success.jsp @@ -49,6 +50,7 @@ + /WEB-INF/fileupload/multipleUploadUsingArray.jsp /WEB-INF/fileupload/multiple-success.jsp diff --git a/apps/showcase/src/main/resources/struts-token.xml b/apps/showcase/src/main/resources/struts-token.xml index ffdf2761a..5f41d1a31 100644 --- a/apps/showcase/src/main/resources/struts-token.xml +++ b/apps/showcase/src/main/resources/struts-token.xml @@ -48,7 +48,7 @@ /WEB-INF/token/doublePost.jsp - /WEB-INF/token/transferDone.jsp + /WEB-INF/token/transferDone.jsp @@ -62,7 +62,7 @@ /WEB-INF/token/doublePost.jsp - /WEB-INF/token/transferDone.jsp + /WEB-INF/token/transferDone.jsp diff --git a/apps/showcase/src/main/resources/struts-validation.xml b/apps/showcase/src/main/resources/struts-validation.xml index 7872d42b0..96d248ff6 100755 --- a/apps/showcase/src/main/resources/struts-validation.xml +++ b/apps/showcase/src/main/resources/struts-validation.xml @@ -34,28 +34,28 @@ - /WEB-INF/validation/index.jsp + index.jsp - quiz-basic.jsp - quiz-success.jsp + /WEB-INF/validation/quiz-basic.jsp + /WEB-INF/validation/quiz-success.jsp - quiz-client.jsp - quiz-success.jsp + /WEB-INF/validation/quiz-client.jsp + /WEB-INF/validation/quiz-success.jsp - quiz-client-css.jsp - quiz-success.jsp + /WEB-INF/validation/quiz-client-css.jsp + /WEB-INF/validation/quiz-success.jsp - quiz-ajax.jsp - quiz-success.jsp + /WEB-INF/validation/quiz-ajax.jsp + /WEB-INF/validation/quiz-success.jsp diff --git a/apps/showcase/src/main/webapp/WEB-INF/fileupload/multiple-success.jsp b/apps/showcase/src/main/webapp/WEB-INF/fileupload/multiple-success.jsp new file mode 100644 index 000000000..3ce6d84bb --- /dev/null +++ b/apps/showcase/src/main/webapp/WEB-INF/fileupload/multiple-success.jsp @@ -0,0 +1,65 @@ + +<%@ page + language="java" + contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib prefix="s" uri="/struts-tags" %> + + + Struts2 Showcase - Fileupload sample - Multiple fileupload + + + + + +
+ + + + + + + + + + + + +
+
+ File (): +
    +
  • ContentType:
  • +
  • FileName:
  • +
  • File:
  • +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/ifTag/testIf.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/ifTag/testIf.jsp index f9fe49997..a0d52a677 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/ifTag/testIf.jsp +++ b/apps/showcase/src/main/webapp/WEB-INF/tags/non-ui/ifTag/testIf.jsp @@ -18,6 +18,7 @@ * under the License. */ --> +<%@page import="org.apache.struts2.showcase.hangman.HangmanConstants" %> <%@taglib prefix="s" uri="/struts-tags" %> @@ -635,5 +636,18 @@ +
+
+

+ A secondary test for this JSP visually verifies expression access to a public constant. + A direct access to the same public constant via scriptlet provides secondary verification. +

+
+
+ Test public static (constant) access (expression). Value: +
+
+ Test public static (constant) access (scriptlet). Value: <%=org.apache.struts2.showcase.hangman.HangmanConstants.HANGMAN_SESSION_KEY%> +
diff --git a/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl b/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl index 46a1ec064..19dac0114 100644 --- a/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl +++ b/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl @@ -50,7 +50,7 @@ <@s.form action="transfer4"> <@s.token/> - <@s.textfield label="Amount" name="amount" required="true" value="400"/> + <@s.textfield label="Amount" name="amount" required=true value="400"/> <@s.submit value="Transfer money" cssClass="btn btn-primary"/>