Search code examples
spring-bootspring-mobile

Spring Boot Mobile doesn't use mobile templates


I recently added spring boot mobile LATEST to my spring boot project, but somehow it won't use the mobile templates.

This is how I configure it to use the specific templates. The default works, but it won't use the mobile templates if I connect with my phone. enabling or disabling fallback doesn't change this.

@Bean
    public LiteDeviceDelegatingViewResolver liteDeviceAwareViewResolver(@Qualifier("thymeleafViewResolver") ViewResolver delegate) {
        LiteDeviceDelegatingViewResolver resolver = new LiteDeviceDelegatingViewResolver(delegate);
        resolver.setMobilePrefix("mobile/");
        resolver.setTabletPrefix("tablet/");
        resolver.setNormalPrefix("default/");
        resolver.setEnableFallback(true);
        resolver.setOrder(1);
        return resolver;
    }

In my properties I added: spring.mobile.devicedelegatingviewresolver.enabled=true

Nothing appears to be helping. Why isn't this working?


Solution

  • Seems that the autoconfiguration is not supporting the mobile module anymore. This post helped me fix it: https://stackoverflow.com/a/49254005/9866079