@Autowired
    private RequestMappingHandlerMapping handlerMapping;

    @Test
    public void getAllApi() {
        Map<RequestMappingInfo, HandlerMethod> map = this.handlerMapping.getHandlerMethods();
        Set<RequestMappingInfo> set = map.keySet();
        for (RequestMappingInfo info : set) {

            HandlerMethod handlerMethod = map.get(info);

            // springmvc的url地址,不包含项目名
            PatternsRequestCondition patternsCondition = info.getPatternsCondition();
            
            
            System.out.println(patternsCondition);

        }
        System.out.println(111);
    }

 

相关文章:

  • 2021-08-30
  • 2022-12-23
  • 2021-06-28
  • 2021-05-26
  • 2022-12-23
  • 2021-12-19
猜你喜欢
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2021-06-05
相关资源
相似解决方案