From 66479bc36ee0c49e5bdfb1175cd8893279ff9fea Mon Sep 17 00:00:00 2001 From: Ted Nathan Husted Date: Sun, 18 Feb 2007 23:26:15 +0000 Subject: [PATCH] WW-1548 Remove continuation support from 2.0.x, which had been classified "sandbox" code. git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_0_X@509029 13f79535-47bb-0310-9956-ffa450edef68 --- apps/showcase/pom.xml | 20 ++---- .../org/apache/struts2/showcase/Guess.java | 71 ------------------- .../main/resources/struts-continuations.xml | 10 --- apps/showcase/src/main/resources/struts.xml | 30 ++++---- .../src/main/webapp/continuations/guess.ftl | 18 ----- apps/showcase/src/main/webapp/showcase.jsp | 14 +--- assembly/pom.xml | 31 ++++---- 7 files changed, 36 insertions(+), 158 deletions(-) delete mode 100644 apps/showcase/src/main/java/org/apache/struts2/showcase/Guess.java delete mode 100644 apps/showcase/src/main/resources/struts-continuations.xml delete mode 100644 apps/showcase/src/main/webapp/continuations/guess.ftl diff --git a/apps/showcase/pom.xml b/apps/showcase/pom.xml index 0bf8906ed..e2593ecd7 100644 --- a/apps/showcase/pom.xml +++ b/apps/showcase/pom.xml @@ -17,7 +17,7 @@ scm:svn:https://svn.apache.org/repos/asf/struts/struts2/trunk/apps/showcase/ http://svn.apache.org/viewcvs.cgi/struts/struts2/trunk/apps/showcase/ - + @@ -31,7 +31,7 @@ - + org.apache.struts struts2-struts1-plugin @@ -55,16 +55,10 @@ struts2-sitemesh-plugin ${pom.version} - - - org.apache.struts - struts2-tiles-plugin - ${pom.version} - org.apache.struts - struts2-continuations-plugin + struts2-tiles-plugin ${pom.version} @@ -79,14 +73,14 @@ struts2-spring-plugin ${pom.version} - + javax.servlet servlet-api 2.4 provided - + velocity @@ -137,9 +131,9 @@ 1.1.1 - + - + diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/Guess.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/Guess.java deleted file mode 100644 index c5b6e48a9..000000000 --- a/apps/showcase/src/main/java/org/apache/struts2/showcase/Guess.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * $Id$ - * - * 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.struts2.showcase; - -import java.util.Random; - -import com.opensymphony.xwork2.Action; -import com.opensymphony.xwork2.ActionSupport; -import com.opensymphony.xwork2.Preparable; -import com.uwyn.rife.continuations.ContinuableObject; - -// START SNIPPET: example -public class Guess extends ActionSupport implements Preparable, ContinuableObject { - int guess; - - public void prepare() throws Exception { - // We clear the error message state before the action. - // That is because with continuations, the original (or cloned) action is being - // executed, which will still have the old errors and potentially cause problems, - // such as with the workflow interceptor - clearErrorsAndMessages(); - } - - public String execute() throws Exception { - int answer = new Random().nextInt(100) + 1; - int tries = 5; - - while (answer != guess && tries > 0) { - pause(Action.SUCCESS); - - if (guess > answer) { - addFieldError("guess", "Too high!"); - } else if (guess < answer) { - addFieldError("guess", "Too low!"); - } - - tries--; - } - - if (answer == guess) { - addActionMessage("You got it!"); - } else { - addActionMessage("You ran out of tries, the answer was " + answer); - } - - return Action.SUCCESS; - } - - public void setGuess(int guess) { - this.guess = guess; - } -} -// END SNIPPET: example diff --git a/apps/showcase/src/main/resources/struts-continuations.xml b/apps/showcase/src/main/resources/struts-continuations.xml deleted file mode 100644 index dc806e3f8..000000000 --- a/apps/showcase/src/main/resources/struts-continuations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - guess.ftl - - - diff --git a/apps/showcase/src/main/resources/struts.xml b/apps/showcase/src/main/resources/struts.xml index b2db05c12..62bcea395 100644 --- a/apps/showcase/src/main/resources/struts.xml +++ b/apps/showcase/src/main/resources/struts.xml @@ -8,15 +8,13 @@ - + - - - + - + @@ -26,19 +24,19 @@ - + - + - + - + - + - + @@ -48,17 +46,17 @@ - + - + - + showcase.jsp - + viewSource.jsp @@ -99,7 +97,7 @@ - {1} + {1} /empmanager/editEmployee.jsp execute diff --git a/apps/showcase/src/main/webapp/continuations/guess.ftl b/apps/showcase/src/main/webapp/continuations/guess.ftl deleted file mode 100644 index 453b0b9a5..000000000 --- a/apps/showcase/src/main/webapp/continuations/guess.ftl +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - -<#list actionMessages as msg> - ${msg} - - -<@s.form action="guess" method="post"> - <@s.textfield label="Guess" name="guess"/> - <@s.submit value="Guess"/> - - - - diff --git a/apps/showcase/src/main/webapp/showcase.jsp b/apps/showcase/src/main/webapp/showcase.jsp index cb029ab37..52dc0d084 100644 --- a/apps/showcase/src/main/webapp/showcase.jsp +++ b/apps/showcase/src/main/webapp/showcase.jsp @@ -1,6 +1,6 @@ -<%-- +<%-- showcase.jsp - + @version $Date$ $Id$ --%> @@ -32,7 +32,7 @@

<%-- THIS LIST IS MAINTAINED IN WEB-INF/decorators/main.jsp TO CREATE THE MENU BAR -- EDIT THERE AND COPY HERE --%>

-

Sandbox

-

- These examples are under development and may not be fully operational. -

- -

diff --git a/assembly/pom.xml b/assembly/pom.xml index 6f9f031b6..7569e25af 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -1,14 +1,14 @@ @@ -423,7 +423,7 @@ 1.2.8 provided - + myfaces @@ -432,13 +432,6 @@ provided - - org.rifers - rife-continuations - 0.0.2 - provided - - javax.servlet