I've a question about the ALPS support in spring hateoas/data rest. It seems that the ALPS metadata are only exposed if you have a spring data rest repository. So my question is why is there only a support for the spring data rest repository and can I enable it for all spring mvc controllers? Is there any example to expose the ALPS metadata for all controllers?
Maybe I haven't understood the conept of ALPS...
Greets
Meleagros
http://spring.io/blog/2014/07/14/spring-data-rest-now-comes-with-alps-metadata
To help us out, Spring Boot generates configuration metadata in a JSON file, which gives us useful information on how to use the properties. So, the configuration metadata is a descriptive file which contains the necessary information for interaction with the configuration properties.
But it also adds a new domain-specific language that provides a functional way of defining controllers. From Spring 5.2 onwards, the functional approach will also be available in the Spring Web MVC framework.
Spring Controller annotation is typically used in combination with annotated handler methods based on the RequestMapping annotation. Spring Controller annotation can be applied on classes only. It’s used to mark a class as a web request handler. It’s mostly used with Spring MVC application.
DispatcherServlet is the front controller in Spring Web MVC. Incoming requests for the HTML file are forwarded to the DispatcherServlet. We have to define the bean in a separate XML file. We have specified the view components in this file. It is located in the WEB-INF directory.
This only partially answers the question, but Oliver Gierke answered the following in the comments on the blog post linked above:
Because it relies on the knowledge of which kinds of links you expose, how you name them and which HTTP methods are supported. With a plain Spring MVC application all of this is out of control of the framework, hence we can't provide it out-of-the-box.
However, Spring HATEOAS contains API to write custom Alps descriptors so that you can expose additional metadata that describe your controllers manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With