【发布时间】:2019-12-31 17:20:34
【问题描述】:
我知道存在类似的问题,但如果仅适用于 glassfish 服务器。
Listing all deployed rest endpoints (spring-boot, jersey)
是否可以使用 spring boot 列出我所有配置的 rest-endpoints?执行器在启动时列出了所有现有路径,我希望我的自定义服务有类似的东西,所以我可以在启动时检查所有路径是否配置正确,并将此信息用于客户端调用。
我该怎么做?我在我的服务 bean 上使用 @Path/@GET 注释并通过 ResourceConfig#registerClasses 注册它们。
有没有办法查询所有路径的配置?
Update2:我想要类似的东西
GET /rest/mycontroller/info
POST /res/mycontroller/update
...
【问题讨论】:
-
见https://stackoverflow.com/a/43543204/1101512。对另一个类似问题的回答可能会有所帮助。
标签: spring spring-boot tomcat