struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject struts git commit: WW-4533 Reverts the old behaviour of how empty action should be handled
Date Thu, 10 Mar 2016 07:47:08 GMT
Repository: struts
Updated Branches:
  refs/heads/master 15857a69e -> 3c68a3def


WW-4533 Reverts the old behaviour of how empty action should be handled


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/3c68a3de
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/3c68a3de
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/3c68a3de

Branch: refs/heads/master
Commit: 3c68a3def6f85570ee5a931f82e5d53f442f0928
Parents: 15857a6
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Thu Mar 10 08:45:12 2016 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Thu Mar 10 08:46:59 2016 +0100

----------------------------------------------------------------------
 .../java/org/demo/rest/example/IndexController.java | 16 ++++++++++++++++
 apps/rest-showcase/src/main/webapp/index.jsp        |  2 --
 .../org/apache/struts2/rest/RestActionMapper.java   |  4 +---
 .../apache/struts2/rest/RestActionMapperTest.java   |  2 +-
 4 files changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/3c68a3de/apps/rest-showcase/src/main/java/org/demo/rest/example/IndexController.java
----------------------------------------------------------------------
diff --git a/apps/rest-showcase/src/main/java/org/demo/rest/example/IndexController.java b/apps/rest-showcase/src/main/java/org/demo/rest/example/IndexController.java
new file mode 100644
index 0000000..0e6d403
--- /dev/null
+++ b/apps/rest-showcase/src/main/java/org/demo/rest/example/IndexController.java
@@ -0,0 +1,16 @@
+package org.demo.rest.example;
+
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
+
+@Results({
+    @Result(name="success", type="redirectAction", params = {"actionName" , "orders"})
+})
+public class IndexController {
+
+    @Action("/")
+    public String index() {
+        return "success";
+    }
+}

http://git-wip-us.apache.org/repos/asf/struts/blob/3c68a3de/apps/rest-showcase/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/apps/rest-showcase/src/main/webapp/index.jsp b/apps/rest-showcase/src/main/webapp/index.jsp
deleted file mode 100644
index 7e3fc9d..0000000
--- a/apps/rest-showcase/src/main/webapp/index.jsp
+++ /dev/null
@@ -1,2 +0,0 @@
-
-<% response.sendRedirect("orders"); %>

http://git-wip-us.apache.org/repos/asf/struts/blob/3c68a3de/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java
----------------------------------------------------------------------
diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java
index 632842f..f1fc41a 100644
--- a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java
+++ b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java
@@ -300,10 +300,8 @@ public class RestActionMapper extends DefaultActionMapper {
             }
 
             mapping.setName(fullName);
-            return mapping;
         }
-        // if action name isn't specified, it can be a normal request, to static resource,
return null to allow handle that case
-        return null;
+        return mapping;
     }
 
     private void handleDynamicMethodInvocation(ActionMapping mapping, String name) {

http://git-wip-us.apache.org/repos/asf/struts/blob/3c68a3de/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
----------------------------------------------------------------------
diff --git a/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
b/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
index f17a071..5492816 100644
--- a/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
+++ b/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
@@ -63,7 +63,7 @@ public class RestActionMapperTest extends TestCase {
 
         ActionMapping mapping = mapper.getMapping(req, configManager);
 
-        assertNull(mapping);
+        assertNotNull(mapping);
     }
 
     public void testGetMapping() throws Exception {


Mime
View raw message