Skip to content

Commit

Permalink
fix occur exception when request mapping of method without values
Browse files Browse the repository at this point in the history
  • Loading branch information
ascrutae committed Aug 14, 2017
1 parent a00291f commit 15785dd
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -29,8 +29,13 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr
PathMappingCache pathMappingCache = (PathMappingCache)objInst.getSkyWalkingDynamicField();
String requestURL = pathMappingCache.findPathMapping(method);
if (requestURL == null) {
requestURL = method.getAnnotation(RequestMapping.class).value()[0];
pathMappingCache.addPathMapping(method, requestURL.toString());
RequestMapping methodRequestMapping = method.getAnnotation(RequestMapping.class);
if (methodRequestMapping.value().length > 0) {
requestURL = methodRequestMapping.value()[0];
} else {
requestURL = "";
}
pathMappingCache.addPathMapping(method, requestURL);
}

HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
Expand Down

0 comments on commit 15785dd

Please sign in to comment.