如何在spring boot中获取所有RequestMapping的URL路径列表集
发布网友
发布时间:2023-07-13 15:19
我来回答
共1个回答
热心网友
时间:2023-09-11 11:13
@Autowired
ApplicationContext applicationContext;
public void getAllRequestMappingInfo() {
AbstractHandlerMethodMapping<RequestMappingInfo> objHandlerMethodMapping = (AbstractHandlerMethodMapping<RequestMappingInfo>)application.getBean(“requestMappingHandlerMapping”);
Map<RequestMappingInfo, HandlerMethod> mapRet = objHandlerMethodMapping.getHandlerMethods();
}