diff --git a/apps/rest-showcase/pom.xml b/apps/rest-showcase/pom.xml index bd8ddd4ac..4af778233 100644 --- a/apps/rest-showcase/pom.xml +++ b/apps/rest-showcase/pom.xml @@ -44,7 +44,7 @@ org.apache.struts - struts2-codebehind-plugin + struts2-convention-plugin ${pom.version} diff --git a/apps/rest-showcase/src/main/java/org/apache/struts2/rest/example/OrdersController.java b/apps/rest-showcase/src/main/java/org/apache/struts2/rest/example/OrdersController.java index f7679155d..8299caafe 100644 --- a/apps/rest-showcase/src/main/java/org/apache/struts2/rest/example/OrdersController.java +++ b/apps/rest-showcase/src/main/java/org/apache/struts2/rest/example/OrdersController.java @@ -2,19 +2,25 @@ package org.apache.struts2.rest.example; import java.util.Collection; -import org.apache.struts2.config.Result; -import org.apache.struts2.config.Results; import org.apache.struts2.dispatcher.ServletActionRedirectResult; import org.apache.struts2.rest.DefaultHttpHeaders; import org.apache.struts2.rest.HttpHeaders; +import org.apache.struts2.convention.annotation.Results; +import org.apache.struts2.convention.annotation.Result; +import org.apache.struts2.convention.annotation.ParentPackage; +import org.apache.struts2.convention.annotation.Namespaces; +import org.apache.struts2.convention.annotation.Namespace; +import org.apache.struts2.convention.annotation.InterceptorRef; import com.opensymphony.xwork2.ModelDriven; import com.opensymphony.xwork2.Validateable; import com.opensymphony.xwork2.ValidationAwareSupport; @Results({ - @Result(name="success", type=ServletActionRedirectResult.class, value="orders") + @Result(name="success", type="redirectAction", params = {"actionName" , "orders"}) }) +@Namespace("") +@InterceptorRef("restDefaultStack") public class OrdersController extends ValidationAwareSupport implements ModelDriven, Validateable{ private Order model = new Order(); diff --git a/apps/rest-showcase/src/main/resources/struts.xml b/apps/rest-showcase/src/main/resources/struts.xml new file mode 100644 index 000000000..42ba6bb9a --- /dev/null +++ b/apps/rest-showcase/src/main/resources/struts.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/apps/rest-showcase/src/main/webapp/orders-deleteConfirm.jsp b/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-deleteConfirm.jsp similarity index 100% rename from apps/rest-showcase/src/main/webapp/orders-deleteConfirm.jsp rename to apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-deleteConfirm.jsp diff --git a/apps/rest-showcase/src/main/webapp/orders-edit.jsp b/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-edit.jsp similarity index 100% rename from apps/rest-showcase/src/main/webapp/orders-edit.jsp rename to apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-edit.jsp diff --git a/apps/rest-showcase/src/main/webapp/orders-editNew.jsp b/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-editNew.jsp similarity index 100% rename from apps/rest-showcase/src/main/webapp/orders-editNew.jsp rename to apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-editNew.jsp diff --git a/apps/rest-showcase/src/main/webapp/orders-index.jsp b/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-index.jsp similarity index 100% rename from apps/rest-showcase/src/main/webapp/orders-index.jsp rename to apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-index.jsp diff --git a/apps/rest-showcase/src/main/webapp/orders-show.jsp b/apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-show.jsp similarity index 100% rename from apps/rest-showcase/src/main/webapp/orders-show.jsp rename to apps/rest-showcase/src/main/webapp/WEB-INF/content/orders-show.jsp diff --git a/apps/rest-showcase/src/main/webapp/WEB-INF/web.xml b/apps/rest-showcase/src/main/webapp/WEB-INF/web.xml index 0bdf3f5c8..d10c214cc 100644 --- a/apps/rest-showcase/src/main/webapp/WEB-INF/web.xml +++ b/apps/rest-showcase/src/main/webapp/WEB-INF/web.xml @@ -13,10 +13,6 @@ action2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter - - actionPackages - org.apache.struts2.rest.example -