提交 1d558c68 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Merge pull request #356 from ascrutae/zhangxin/fix/spring-mvc-issue

fix occur exception when request mapping of method without values
......@@ -29,8 +29,13 @@ public class ControllerServiceMethodInterceptor implements InstanceMethodsAround
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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册