I am using spring-data-rest(1.0.0.RELEASE) in my spring-mvc application But I am getting following problem
In my WebConfig
@Import(RepositoryRestMvcConfiguration.class)
public static class WebConfiguration extends WebMvcConfigurationSupport{...}
Here this case RepositoryRestMvcConfiguration
has a bean RepositoryRestController
which has method listRepositories(...)
annotated with
@RequestMapping(value = "/", method = RequestMethod.GET)
Now the problem is that when I am hitting at the root context ("/")
then I am getting links to my repositories, like below
{
"links" : [ {
"rel" : "content",
"href" : "http://localhost:7070/appName/content"
}, {
"rel" : "language",
"href" : "http://localhost:7070/appName/language"
} ],
"content" : [ ]
}
But I want to show index.html file instead.
I want to disable discovery of links at root context.
Event I tried with my custom controller to map to the root context("/")
but spring at the first priority matches the RepositoryRestController's.listRepositories(...)
method.
Its not coming to my controller method. In log its comes like this
**RepositoryRestHandlerMapping**: 185 - Mapped "{[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.data.rest.webmvc.RepositoryRestController.listRepositories(org.springframework.http.server.ServletServerHttpRequest,java.net.URI) throws java.io.IOException
**RequestMappingHandlerMapping**: 185 - Mapped "{[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String xxx.xx.xx.AccessController.getIndex()