我在按照spring官网给出的指南《Building REST services with Spring》中遇到了Resource类等无法找到的问题。这个问题是由于Spring Hateoas的版本变更,而官方指南未及时更新造成的。在新的Spring Hateoas更新日志(1.1版)有说明,如下:
对应的类名已经变更:
-
->ResourceSupport
RepresentationModel
-
->Resource
EntityModel
-
->Resources
CollectionModel
-
->PagedResources
PagedModel
-
ControllerLinkBuilder转移到server.mvc
包中,废弃并更名为
WebMvcLinkBuilder
此外还有一些变更在我的demo中没有用上,具体可以参考官方原本的文档。
目前还没有百度到类似的问题,遂特此记录。