I cannot seem to get a static resource from my springboot server. I used t

I cannot seem to get a static resource from my springboot server.

I used the version 2.1.1 of the app layout add-on.

I am using vaadin and springboot. No matter what I do I cannot serve a resource from the client.

.addToSection(new LeftHeaderItem(“Menu-Header”
“APP_LAYOUT_VERSION”,
“/images/eye-logo.jpg”),
HEADER)

In the example a placeholder was left in the code. I’ve tried many things but can’t get resource serving to work.

Any clues?

Got it to work, however don’t take what I say as authoritive as I’ve just starting to look at vaadin.

I needed a servlet to serve resoures. I could do this using spring mvc so I did used the WebMvcConfigurer. I linked the resource images etc to prefix the url with “/resources” to let the mvc servlet serve resources from my jar classpath.

I Added the class derived from spring mvc:

@Configuration
@EnableWebMvc
public class ApplicationMvcConfigurer implements WebMvcConfigurer
{
    @Override
    public void addResourceHandlers (ResourceHandlerRegistry registry)
    {
        registry.addResourceHandler("/resources/**")
                .addResourceLocations("classpath:/");
    }
}

and in the LayoutRouterLayout class which extends AppLayoutRouterLayout I prefixes the src= name for img with “/resources” being download my resources

.addToSection(new LeftHeaderItem("Menu-Header",
			                     "APP_LAYOUT_VERSION",
							     "/resources/images/digital-eye-logo.jpg"),
			 HEADER)

Any neater approach please let me know