spring - Spring 操作的可用路径列表

标签 spring rest spring-webflow spring-annotations

我有一个使用 spring 注释和 Spring MVC 公开 RESTful 操作的应用程序。

看起来像

@RequestMapping(value = "/example/{someId}", 
    method = RequestMethod.GET, consumes=MediaType.APPLICATION_JSON_VALUE, 
    produces=MediaType.APPLICATION_JSON_VALUE)
@ResponseBody 
public void isRegisteredToThread(@PathVariable long someId, HttpServletResponse response) {

    [something]
}

我想要的是自动生成的所有 URL、方法和可用参数的列表——可能在 WSDL 中。是否有插件或是否可用?

最佳答案

WSDL 不是为了休息而完成的,它用于 SOAP。

您可能会使用 WADL,但我真的不建议这样做。

在我的项目中,我总是使用 swagger(有一个针对 spring 的版本)。您可以在此处找到更多信息 https://github.com/martypitt/swagger-springmvc在这里 http://blog.zenika.com/index.php?post/2013/07/11/Documenting-a-REST-API-with-Swagger-and-Spring-MVC

试一试。

作为替代方案,如果您不需要基于网络的东西,您可以尝试 rest-shell ( https://github.com/spring-projects/rest-shell )

关于spring - Spring 操作的可用路径列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15570496/

相关文章:

java - Spring Boot/Data JPA EntityScan 递归

java - 使用 Spring RestTemplate for Android 发出经过身份验证的 POST 请求

Spring Webflow 2.4.2 缺少启动状态

java - <mvc :annotation-driven/> shows compile time error

java - 字符串格式 Thymeleaf Spring Boot

java - 注入(inject)方法/变量 : public or Not?

java - 如何将改造 JSON 响应转换为列表?

用于链接实体的 REST 端点

rest - Azure Blob 存储 REST Api - 如何将 header 写入字符串

spring - 使用 Java 配置配置 Spring Web Flow