@Autowired
private RequestMappingHandlerMapping requestMappingHandlerMapping;
@Test
public void get() {
Map<RequestMappingInfo, HandlerMethod> map = requestMappingHandlerMapping.getHandlerMethods();
for (Map.Entry<RequestMappingInfo, HandlerMethod> m : map.entrySet()) {
RequestMappingInfo info = m.getKey();
HandlerMethod method = m.getValue();
System.out.println("url:" + info.getPatternsCondition() + " |class:" + method.getMethod().getDeclaringClass() + " |function:" + method.getMethod().getName());
}
}
springmvc获取全部接口信息
最新推荐文章于 2022-03-22 17:26:01 发布