This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-5241-exec-and-wait
in repository https://gitbox.apache.org/repos/asf/struts.git

commit 26effbf05de95ff9188b6cfe2ef930908bb6ba96
Author: Lukasz Lenart <lukaszlen...@apache.org>
AuthorDate: Thu Oct 13 15:39:07 2022 +0200

    WW-5241 Improves Exec&Wait example in Showcase app
---
 apps/showcase/src/main/resources/struts-wait.xml   |  4 ++
 .../src/main/webapp/WEB-INF/decorators/main.jsp    |  2 +-
 .../src/main/webapp/WEB-INF/wait/complete.jsp      | 29 ++++-----
 .../src/main/webapp/WEB-INF/wait/index.jsp         | 53 +++++++++++++++++
 .../showcase/src/main/webapp/WEB-INF/wait/wait.jsp | 68 ++++++++--------------
 apps/showcase/src/main/webapp/wait/index.html      | 53 -----------------
 6 files changed, 97 insertions(+), 112 deletions(-)

diff --git a/apps/showcase/src/main/resources/struts-wait.xml 
b/apps/showcase/src/main/resources/struts-wait.xml
index 7b6a204a6..b237dac68 100644
--- a/apps/showcase/src/main/resources/struts-wait.xml
+++ b/apps/showcase/src/main/resources/struts-wait.xml
@@ -28,6 +28,10 @@
     <bean type="org.apache.struts2.interceptor.exec.ExecutorProvider" 
class="org.apache.struts2.showcase.wait.ThreadPoolExecutorProvider"/>
 
     <package name="wait" extends="struts-default" namespace="/wait">
+        <default-action-ref name="index"/>
+        <action name="index">
+            <result>/WEB-INF/wait/index.jsp</result>
+        </action>
 
         <action name="example1">
             <result>/WEB-INF/wait/example1.jsp</result>
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 d63f61f9a..ff1353032 100644
--- a/apps/showcase/src/main/webapp/WEB-INF/decorators/main.jsp
+++ b/apps/showcase/src/main/webapp/WEB-INF/decorators/main.jsp
@@ -239,7 +239,7 @@
                             </li>
                             <li><s:a value="/person/index.html">Person 
Manager</s:a></li>
                             <li><s:a value="/skill/index.html">CRUD</s:a></li>
-                            <li><s:a value="/wait/index.html">Execute &amp; 
Wait</s:a></li>
+                            <li><s:a value="/wait/index">Execute &amp; 
Wait</s:a></li>
                             <li><s:a value="/token/index.html">Token</s:a></li>
                             <li><s:url var="url" namespace="/modelDriven" 
action="modelDriven"/><s:a
                                     href="%{url}">Model Driven</s:a></li>
diff --git a/apps/showcase/src/main/webapp/WEB-INF/wait/complete.jsp 
b/apps/showcase/src/main/webapp/WEB-INF/wait/complete.jsp
index 74c97c74c..47cbb0674 100644
--- a/apps/showcase/src/main/webapp/WEB-INF/wait/complete.jsp
+++ b/apps/showcase/src/main/webapp/WEB-INF/wait/complete.jsp
@@ -1,19 +1,19 @@
 <!--
 /*
 * Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
+* or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
+* 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
+* with the License. You may obtain a copy of the License at
 *
-*  http://www.apache.org/licenses/LICENSE-2.0
+* 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
+* KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
@@ -21,25 +21,26 @@
 <%@ taglib prefix="s" uri="/struts-tags" %>
 <html>
 <head>
-       <title>Struts2 Showcase - Execute and Wait Examples - Complete</title>
+    <title>Struts2 Showcase - Execute and Wait Examples - Complete</title>
 </head>
 
 <body>
 <div class="page-header">
-       <h1>The process is complete</h1>
+    <h1>The process is complete</h1>
 </div>
 
 
 <div class="container-fluid">
-       <div class="row">
-               <div class="col-md-12" style="text-align: center;">
+    <div class="row">
+        <div class="col-md-12" style="text-align: center;">
 
-                       <b>We have processed your request.</b>
-                       <p/>
-                       Click here to <s:url var="back" 
value="/wait/index.html"/><s:a href="%{back}" cssClass="btn 
btn-link">return</s:a>.
+            <div class="panel">We have processed your request.</div>
 
-               </div>
-       </div>
+            <s:url var="back" value="/wait/index"/>
+            Click here to <s:a href="%{back}" cssClass="btn 
btn-primary">return</s:a>
+
+        </div>
+    </div>
 </div>
 </body>
 </html>
diff --git a/apps/showcase/src/main/webapp/WEB-INF/wait/index.jsp 
b/apps/showcase/src/main/webapp/WEB-INF/wait/index.jsp
new file mode 100644
index 000000000..b0d10cd1c
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/wait/index.jsp
@@ -0,0 +1,53 @@
+<!--
+/*
+* 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.
+*/
+-->
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+    <title>Struts2 Showcase - Execute and Wait Examples</title>
+</head>
+
+<body>
+<div class="page-header">
+    <h1>Execute and Wait Examples</h1>
+</div>
+
+<div class="container-fluid">
+    <div class="row">
+        <div class="col-md-12" style="text-align: center;">
+
+            <p>
+                These examples illustrate Struts build in support for execute 
and wait.
+            <p/>
+            <p>
+                When you have a process that takes a long time your users can 
be impatient and starts to submit/click
+                again.
+                <br/> A good solution is to show the user a progress page 
(wait page) while the process takes it time.
+            <p/>
+
+            <br/>
+            <br/><a href='<s:url value="example1"/>'>Example 1 (no delay)</a>
+            <br/><a href='<s:url value="example2"/>'>Example 2 (with delay)</a>
+            <br/><a href='<s:url value="example3"/>'>Example 3 (with longer 
check delay)</a>
+        </div>
+    </div>
+</div>
+</body>
+</html>
diff --git a/apps/showcase/src/main/webapp/WEB-INF/wait/wait.jsp 
b/apps/showcase/src/main/webapp/WEB-INF/wait/wait.jsp
index e4b467968..57f169d87 100644
--- a/apps/showcase/src/main/webapp/WEB-INF/wait/wait.jsp
+++ b/apps/showcase/src/main/webapp/WEB-INF/wait/wait.jsp
@@ -1,19 +1,19 @@
 <!--
 /*
 * Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
+* or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
+* 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
+* with the License. You may obtain a copy of the License at
 *
-*  http://www.apache.org/licenses/LICENSE-2.0
+* 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
+* KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
@@ -21,53 +21,33 @@
 <%@ taglib prefix="s" uri="/struts-tags" %>
 <html>
 <head>
-       <title>Struts2 Showcase - Execute and Wait Examples - Wait</title>
+    <title>Struts2 Showcase - Execute and Wait Examples - Wait</title>
+    <meta http-equiv="refresh" content="5;url=<s:url includeParams="all"/>"/>
 </head>
 
 <body>
 <div class="page-header">
-       <h1>Execute and Wait Examples - Wait</h1>
+    <h1>Execute and Wait Examples - Wait</h1>
 </div>
 
 
 <div class="container-fluid">
-       <div class="row">
-               <div class="col-md-12" style="text-align: center;">
-
-                       <p class="well">
-                               We are processing your request. Please wait.
-                       </p>
-
-                       <div class="progress progress-striped active">
-                               <div class="bar" style="width: 50%;"></div>
-                       </div>
-
-                       <p/>
-                       You can click this link to <a href="<s:url 
includeParams="all"/>">refresh</a>.
-
-                       <b>We have processed your request.</b>
-                       <p/>
-                       Click here to <s:url var="back" 
value="/wait/index.html"/><s:a href="%{back}" cssClass="btn 
btn-link">return</s:a>.
-
-               </div>
-       </div>
+    <div class="row">
+        <div class="col-md-12" style="text-align: center;">
+
+            <p class="well">
+                We are processing your request. Please wait.
+            </p>
+
+            <div class="progress progress-striped active">
+                <div class="bar progress-bar progress-bar-success" 
style="width: 50%;"></div>
+            </div>
+
+            <div class="panel">
+                You can click this link to <a href="<s:url 
includeParams="all"/>">refresh</a>.
+            </div>
+        </div>
+    </div>
 </div>
 </body>
 </html>
-
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<html>
-<head>
-    <meta http-equiv="refresh" content="5;url=<s:url includeParams="all"/>"/>
-</head>
-
-<body>
-    <p style="border: 1px solid silver; padding: 5px; background: #ffd; 
text-align: center;">
-        We are processing your request. Please wait.
-    </p>
-
-    <p/>
-    You can click this link to <a href="<s:url 
includeParams="all"/>">refresh</a>.
-
-</body>
-</html>
diff --git a/apps/showcase/src/main/webapp/wait/index.html 
b/apps/showcase/src/main/webapp/wait/index.html
deleted file mode 100644
index 6d18878a9..000000000
--- a/apps/showcase/src/main/webapp/wait/index.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!--
-/*
- * 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.
- */
--->
-<html>
-<head>
-       <title>Struts2 Showcase - Execute and Wait Examples</title>
-</head>
-
-<body>
-<div class="page-header">
-       <h1>Execute and Wait Examples</h1>
-</div>
-
-
-
-<div class="container-fluid">
-       <div class="row">
-               <div class="col-md-12" style="text-align: center;">
-
-                       <p>
-                               These examples illustrate Struts build in 
support for execute and wait.
-                       <p/>
-                       <p>
-                               When you have a process that takes a long time 
your users can be impatient and starts to submit/click again.
-                               <br/> A good solution is to show the user a 
progress page (wait page) while the process takes it time.
-                       <p/>
-
-                       <br/>
-                       <br/><a href="example1.action">Example 1 (no delay)</a>
-                       <br/><a href="example2.action">Example 2 (with 
delay)</a>
-                       <br/><a href="example3.action">Example 3 (with longer 
check delay)</a>
-               </div>
-       </div>
-</div>
-</body>
-</html>

Reply via email to