AaronYu
2019-12-01
老师,我自己写例子练习时:@RepositoryRestResource(path = "/coffee") 这个注解加上去后,报了错误如下:Path /coffee configured for aaron.spring.web.hateoaswaiterservice.repository.CoffeeRepository must only contain a single path segment!
然后我去掉注解,正常启动。
SpringBoot 2.2.1 版本。

作者回复: 把/去掉,即@RepositoryRestResource(path = "coffee") 。我用了你说的版本,发现RepositoryCollectionResourceMapping里有如下判断it.contains("/"),因此去掉/就好了。

评论 0
empty

暂无评论