Always use default method if wildcard patter returned null or empty
Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/146b44e2 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/146b44e2 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/146b44e2 Branch: refs/heads/master Commit: 146b44e2e8bce1353832e4bb261381bc60268a66 Parents: 0a08f6b Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Fri Oct 30 09:21:54 2015 +0100 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Fri Oct 30 09:21:54 2015 +0100 ---------------------------------------------------------------------- .../xwork2/config/impl/ActionConfigMatcher.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/146b44e2/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java b/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java index 7f17e41..3105437 100644 --- a/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java +++ b/core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java @@ -21,7 +21,7 @@ import com.opensymphony.xwork2.config.entities.ActionConfig; import com.opensymphony.xwork2.config.entities.ExceptionMappingConfig; import com.opensymphony.xwork2.config.entities.ResultConfig; import com.opensymphony.xwork2.util.PatternMatcher; -import com.opensymphony.xwork2.util.WildcardHelper; +import org.apache.commons.lang3.StringUtils; import java.io.Serializable; import java.util.ArrayList; @@ -77,7 +77,12 @@ public class ActionConfigMatcher extends AbstractMatcher<ActionConfig> implement Map<String, String> vars) { String methodName = convertParam(orig.getMethodName(), vars); - if (methodName != null && !orig.isAllowedMethod(methodName)) { + + if (StringUtils.isEmpty(methodName)) { + methodName = ActionConfig.DEFAULT_METHOD; + } + + if (!orig.isAllowedMethod(methodName)) { return null; }