But the image shows a blank. If I change relativePath to file I get an exception.
I have it in the main resources directory but that seems to not be correct. Better documentation of the file system and where things need to go would be super helpful…
The relative path resource is a resource that is stored in the directory of deployed application. if you check the generated url for a relative path, you’ll see something like this:
<img ... src="http://localhost:8080/test.jpg">
Obviously, every file placed in the resources directory cannot be accessed via a URL due to security measures. To get access to a file using the relative path resource approach, you need to create a VAADIN folder in the root of the resource directory, because files stored in this directory is accessible via URL, e.g.: