Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ALPS metadata for all Spring-MVC Controller

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

like image 289
meleagros Avatar asked Aug 24 '14 08:08

meleagros


People also ask

What is configuration metadata in Spring Boot?

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.

Is there a functional way of defining controllers in spring?

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.

What is the use of controller annotation in spring?

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.

What is DispatcherServlet in Spring MVC?

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.


1 Answers

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.

like image 70
Claus Nielsen Avatar answered Sep 30 '22 09:09

Claus Nielsen