SPR-5726: Unexpected @RequestMapping semantics when class-level and method-level mappings used together

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1128 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Arjen Poutsma
2009-05-08 10:02:17 +00:00
parent 1d1dba1693
commit e22f772c4c
2 changed files with 4 additions and 2 deletions
@@ -62,6 +62,7 @@ import org.springframework.util.AntPathMatcher;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.PathMatcher;
import org.springframework.util.StringUtils;
import org.springframework.validation.support.BindingAwareModelMap;
@@ -502,7 +503,8 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator implemen
}
private boolean isPathMatch(String methodLevelPattern, String lookupPath) {
if (isPathMatchInternal(methodLevelPattern, lookupPath)) {
if ((!hasTypeLevelMapping() || ObjectUtils.isEmpty(getTypeLevelMapping().value())) &&
isPathMatchInternal(methodLevelPattern, lookupPath)) {
return true;
}
if (hasTypeLevelMapping()) {