删除默认的 Spring Boot 欢迎页面 [英] Remove default spring boot welcome page

查看:42
本文介绍了删除默认的 Spring Boot 欢迎页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Spring Boot Restful 应用程序,但如果我访问以下 URL:

I have a spring boot restful application but if I go to the following URLS:

http://localhost:8080

http://localhost:8080/profile

然后我看到一些默认的 spring boot JSON,如下所示:

I then see some default spring boot JSON like the following:

{


  "_links" : {


    "customerEntities" : {

    "href" : "http://localhost:8080/customerEntities{?page,size,sort}",
    "templated" : true
   },
  "profile" : {
     "href" : "http://localhost:8080/profile"
   }
 }
}

如何禁用此功能?我不希望那些页面出现

how can I disable this? I dont want those pages apearing

推荐答案

因为 Spring HATEOAS 和 Spring Data JPA 并自动将它们组合在一起.

Because Spring HATEOAS and Spring Data JPA and combines them together automatically.

此依赖项进行了这些更改

This dependency make these changes

 <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-rest</artifactId>
 </dependency> 

因此检查您的项目是否需要或删除依赖项并检查

so check this need for your your project or remove the dependency and check

更多

这篇关于删除默认的 Spring Boot 欢迎页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆