我有一个 Spring Boot Restful 应用程序,但如果我访问以下 URL:
http://localhost:8080
http://localhost:8080/profile
然后我看到一些默认的 Spring Boot JSON,如下所示:
{
"_links" : {
"customerEntities" : {
"href" : "http://localhost:8080/customerEntities{?page,size,sort}",
"templated" : true
},
"profile" : {
"href" : "http://localhost:8080/profile"
}
}
}
如何禁用此功能?我不希望这些页面出现
最佳答案
因为 Spring HATEOAS 和 Spring Data JPA 并自动将它们组合在一起。
此依赖项进行这些更改
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
因此请检查您的项目的需求或删除依赖项并检查
关于java - 删除默认的 Spring Boot 欢迎页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42951284/