@Autowired
WebApplicationContext applicationContext;
@GetMapping("/getParam")
public String getParam(){
RequestMappingHandlerMapping mapping = applicationContext.getBean(RequestMappingHandlerMapping.class);
Map<RequestMappingInfo, HandlerMethod> methodMap = mapping.getHandlerMethods();
List<String> urlList = new ArrayList<>();
for (RequestMappingInfo info : methodMap.keySet()){
Set<String> urlSet = info.getPatternsCondition().getPatterns();
Set<RequestMethod> Methods = info.getMethodsCondition().getMethods();
System.out.println(Methods.toString());
for (String url : urlSet){
urlList.add("http://localhost:XXXX"+url);
}
}
return urlList.toString();
}