#1080 - Improved configuration setup and documentation on EntityLinks.

We now explicitly only enable EntityLinks in WebMVC environments. This is also now reflected properly in the reference documentation.
This commit is contained in:
Oliver Drotbohm
2019-09-26 15:21:35 +02:00
parent 26a0dd8794
commit 30ddf1873c
4 changed files with 26 additions and 15 deletions

View File

@@ -28,7 +28,6 @@ import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;
import org.springframework.context.support.AbstractMessageSource;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
@@ -58,7 +57,6 @@ import org.springframework.util.ClassUtils;
* @since 0.19
*/
@Configuration
@Import(EntityLinksConfiguration.class)
@EnablePluginRegistries({ LinkDiscoverer.class })
public class HateoasConfiguration {

View File

@@ -30,7 +30,7 @@ import org.springframework.stereotype.Controller;
* @author Oliver Gierke
*/
@Configuration
class WebMvcEntityLinksConfiguration {
class WebMvcEntityLinksConfiguration extends EntityLinksConfiguration {
@Bean
ControllerEntityLinksFactoryBean webMvcEntityLinks(ObjectProvider<WebMvcLinkBuilderFactory> linkBuilderFactory) {