【问题标题】:Do I need webstarter in order to use just RestController annotation?我是否需要 webstarter 才能仅使用 RestController 注释?
【发布时间】:2018-07-27 21:03:25
【问题描述】:

我在网上看到了一个 Spring Boot web 启动器示例,其中包含启动器只是为了使用 Restcontroller 注释,但我正在做一个小 poc,我可以看到我不需要它......我错过了一些东西或在我看到的这个例子中,添加启动器确实有点过头了?

【问题讨论】:

    标签: spring-boot spring-restcontroller spring-boot-starter


    【解决方案1】:

    为了在您的 PoC 中使用 @RestController,您必须将 spring-boot-starter-web 工件包含到类路径中。

    【讨论】:

      猜你喜欢
      • 2014-02-21
      • 1970-01-01
      • 2017-06-11
      • 2011-08-22
      • 1970-01-01
      • 1970-01-01
      • 2019-04-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多