StreamResource and Dynamic URL Creation

I’ve created an Anchor tag and associated an StreamResouce and when I click on the anchor a new document displays in a new tab, just what I want but the URL is now missing my @Route general landing page and contains http://localhost:9999//VAADIN/dynamic/resource/ which is okay in my local development but will cause issue when I deploy since we are using SSO and landing pages to enforce secure access. Is there any way to adjust the “//VAADIN/dynamic/resource” to include my @Route? E.g. /contextroot/myhomepage/VAADIN/dynamic/resource.

Version 14 of Vaadin is being used

Vaadin web application is just a web application which uses Servlet specification.
VaadinServlet handles all the requests when you access the page.
The whole web application (WAR) can be deployed to the servlet context.
You may chose a non default (root) servlet context e.f. “some-context” for your web application.
In this case all servlets handles URI which starts from prefix “/some-context”.
“/some-context” becomes a new “root” which any URI is using to access the web app: everything outside of “/some-context” doesn’t belong to the application.

Dynamic resource always has a path starting from “/VAADIN/dynamic/resource” in the web application.
So it never respects any route inside the application.
The only way to change the root url is changing the servlet context.
So you should just deploy your application using /contextroot/myhomepage/ as a servlet context for the whole application.

There is another way to do similar thing via URL mapping for servlet: context root affects any servlet in the whole web application. But it’s possible to have several servlets in one application. Every servlet declares URL mapping and /VAADIN/dynamic/resource/ is handled per URL mapping. So you may create a servlet with the required mapping.

But Routes inside the application never used for the dynamic resource.