The Shoe Shiner
The Shoe Shiner

Reputation: 756

How to access Vaadin /frontend resources statically in spring boot application

Vaadin flow examples specify that styles should be placed in: /frontend/styles

This allows them to be importing in Vaadin views/components, but I need to access some of these files statically as well. What is the proper web url for accessing these style files? Or is this impossible?

The following URLs do not work:

I understand that /src/main/resources/META-INF/resources is also served statically, but I need to avoid having separate copies of the same file.

Edit:

The page I want to print is pure HTML. Rendered in a popup via JS:

var a = window.open('', '', 'height=1000, width=1500');
a.document.write('<html>...</html>');

The Html contains link tags to the css:

<link type="text/css" rel="stylesheet" href="/styles/print.css" />

Upvotes: 1

Views: 246

Answers (1)

ollitietavainen
ollitietavainen

Reputation: 4290

The files under the /frontend folder are bundled into the frontend bundle in production mode, they are not available as separate files; even though you might be able to access one in development mode, you shouldn't count on that behavior.

Upvotes: 2

Related Questions