我在按照spring官网给出的指南《Building REST services with Spring》中遇到了Resource类等无法找到的问题。这个问题是由于Spring Hateoas的版本变更,而官方指南未及时更新造成的。在新的Spring Hateoas更新日志(1.1版)有说明,如下:

 

Springboot spring hateoas使用过程中遇到的问题记录

对应的类名已经变更:

  • ResourceSupport -> RepresentationModel

  • Resource -> EntityModel

  • Resources -> CollectionModel

  • PagedResources -> PagedModel

  • ControllerLinkBuilder转移到server.mvc包中,废弃并更名为WebMvcLinkBuilder

此外还有一些变更在我的demo中没有用上,具体可以参考官方原本的文档。

目前还没有百度到类似的问题,遂特此记录。

相关文章:

  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2021-04-01
  • 2021-11-07
  • 2021-04-14
  • 2021-04-04
  • 2021-09-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2021-10-16
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案