Skip to content

Commit

Permalink
WW-4533 Reverts the old behaviour of how empty action should be handled
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Mar 10, 2016
1 parent b155532 commit 609cb0b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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";
}
}
2 changes: 0 additions & 2 deletions apps/rest-showcase/src/main/webapp/index.jsp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -283,18 +283,16 @@ public ActionMapping getMapping(HttpServletRequest request,
if (id != null) {
if (!"new".equals(id)) {
if (mapping.getParams() == null) {
mapping.setParams(new HashMap());
mapping.setParams(new HashMap<String, Object>());
}
mapping.getParams().put(idParameterName, new String[]{id});
}
fullName = fullName.substring(0, lastSlashPos);
}

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void testRootMapping() throws Exception {

ActionMapping mapping = mapper.getMapping(req, configManager);

assertNull(mapping);
assertNotNull(mapping);
}

public void testGetMapping() throws Exception {
Expand Down

0 comments on commit 609cb0b

Please sign in to comment.