Java 使用数据rest包时生成的更改/配置文件端点
使用软件包spring boot starter data时,rest spring会自动为阿尔卑斯山创建一些名为/profile的端点,如下所示:Java 使用数据rest包时生成的更改/配置文件端点,java,spring,spring-boot,Java,Spring,Spring Boot,使用软件包spring boot starter data时,rest spring会自动为阿尔卑斯山创建一些名为/profile的端点,如下所示: 2017-03-08 22:09:12.737 INFO 8663 --- [ restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping : Mapped "{[/profile],methods=[OPTIONS]}" onto public org.springframework.htt
2017-03-08 22:09:12.737 INFO 8663 --- [ restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping : Mapped "{[/profile],methods=[OPTIONS]}" onto public org.springframework.http.HttpEntity<?> org.springframework.data.rest.webmvc.ProfileController.profileOptions()
2017-03-08 22:09:12.738 INFO 8663 --- [ restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping : Mapped "{[/profile],methods=[GET]}" onto org.springframework.http.HttpEntity<org.springframework.hateoas.ResourceSupport> org.springframework.data.rest.webmvc.ProfileController.listAllFormsOfMetadata()
2017-03-08 22:09:12.738 INFO 8663 --- [ restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping : Mapped "{[/profile/{repository}],methods=[GET],produces=[application/schema+json]}" onto public org.springframework.http.HttpEntity<org.springframework.data.rest.webmvc.json.JsonSchema> org.springframework.data.rest.webmvc.RepositorySchemaController.schema(org.springframework.data.rest.webmvc.RootResourceInformation)
2017-03-08 22:09:12.738 INFO 8663 --- [ restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping : Mapped "{[/profile/{repository}],methods=[OPTIONS],produces=[application/alps+json]}" onto org.springframework.http.HttpEntity<?> org.springframework.data.rest.webmvc.alps.AlpsController.alpsOptions()
2017-03-08 22:09:12.738 INFO 8663 --- [ restartedMain] o.s.d.r.w.BasePathAwareHandlerMapping : Mapped "{[/profile/{repository}],methods=[GET],produces=[application/alps+json || */*]}" onto org.springframework.http.HttpEntity<org.springframework.data.rest.webmvc.RootResourceInformation> org.springframework.data.rest.webmvc.alps.AlpsController.descriptor(org.springframework.data.rest.webmvc.RootResourceInformation)
2017-03-08 22:09:12.737 INFO 8663-[restartedMain]o.s.d.r.w.BasePathAwareHandlerMapping:将“{[/profile],methods=[OPTIONS]}”映射到public org.springframework.http.HttpEntity org.springframework.data.rest.webmvc.ProfileController.profileOptions()上
2017-03-08 22:09:12.738信息8663---[restartedMain]o.s.d.r.w.BasePathAwareHandlerMapping:将“{[/profile],methods=[GET]}”映射到org.springframework.http.HttpEntity org.springframework.data.rest.webmvc.ProfileController.listAllFormsOfMetadata()
2017-03-08 22:09:12.738信息8663---[restartedMain]o.s.d.r.w.BasePathAwareHandlerMapping:Mapping“{[/profile/{repository}],methods=[GET],products=[application/schema+json]}”到public org.springframework.http.HttpEntity org.springframework.data.rest.webmvc.RepositorySchemaController.schema(org.springframework.data.rest.webmvc.RootResourceInformation)
2017-03-08 22:09:12.738信息8663---[restartedMain]o.s.d.r.w.BasePathAwareHandlerMapping:Mapping“{[/profile/{repository}],methods=[OPTIONS],products=[application/alps+json]}”到org.springframework.http.HttpEntity org.springframework.data.rest.webmvc.alps.AlpsController.alpsOptions()
2017-03-08 22:09:12.738信息8663---[restartedMain]o.s.d.r.w.BasePathAwareHandlerMapping:Mapping“{[/profile/{repository}],methods=[GET],products=[application/alps+json | | |*/*])到org.springframework.http.HttpEntity.springframework.data.rest.webmvc.alps.AlpsController.descriptor上(org.springframework.data.rest.webmvc.RootResourceInformation)
问题是我还有一个名为profile的RestRepository
,所以我也将使用这些端点
问题是:
如何将端点更改为其他东西?甚至将其取下。将以下内容添加到application.properties文件中
endpoints.enabled=false
这将禁用spring/actuator提供的所有公共端点
management.context路径=/public
这将把/public附加到所有spring提供的端点,例如/profile。它不起作用。。profile端点仍然保持原样。