Add another UrlHandlerMapping to Spring data rest -
I have a normal Spring-MVC project and I am also building the rest
module The target occurs as a separate jar file when I have jar /
and spring data - The rest of the repository has been mapped to / rest
. For the rest
module, I have defined a WebApplicationInitializer
with the repository RASTMVC configuration
and it all works well.
So now I want to add the rest
module (like / synchronize
, and some more
, etc.) but as soon as I add the controller to the url
) / Certify rest
module, the original application context (website /
). I tried to designate them as bean in the repository RSTMVC configuration
but they are still taken with other original references and the filters of the original reference are removed. And when I access spring data-rest by means of / rest
no filter starts up
So I was wondering: What is the method I < Code> repository RASTMVC configuration so that I add additional URL handler mapping?
I believe that you are the second controller advertised as part of the root data rest of the hormimedia Want to
To do this, you need to create another category in your app like this:
@ Companent Class Dogfire Resusprocesser Applied Processing Processor & lt; Repository link resource & gt; {@Override Public RepositoryLinksResource Processes (RepositoryLinksResource Objects) {objects.add (new link (ServletUriComponentsBuilder.fromCurrentRequest () .build () .toUriString () .concat ("dogifier / {ID}"), "dogifier"); Return items; }}
This will create a hypermedia entry with rel = "dogifier" which lists lists / dogifier / {id} as the URI. It will also be with the proper uran etc. already.
Of course, you can use Spring Hats without specifying the actual path by hand. This will reduce maintenance and better hypermedia controls will be encouraged.
Comments
Post a Comment