Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Static basePath in AbstractApplicationServlet
I know that i have asked this before, but did not get a sufficient answer from you guys. Or at least not any answer that I was happy with :-)
Have an app that is running within a OSGi container (that is not important) and this Vaadin servlet is attached at /console/* path. Context path of this applicaiton is / (root). All static files are now served from /VAADIN/* and this is causing problems for me.
So I would like to set a static serving basePath on the servlet to /console so that themes and wigetsets for this servlet is served under /console/VAADIN/(themes|widgetsets).
Have investigated some possibilities on how to set a static basePath for the servlet but it seems that it's not that easily fixed by extending AbstractApplicationServlet. Anyone have some tips on this?
It is a real blocker for me right now. Seems to me that it is really easy to fix inside AbstractApplicationServlet or extensions if some private methods could be made protected.
Regards,
Sten Roger Sandvik
Try adding
<init-param>
<description>Location of VAADIN folder</description>
<param-name>Resources</param-name>
<param-value>/console</param-value>
</init-param>
to your web.xml and see if it works. Not sure it does but the code in AbstractApplicationServlet suggests it should.
I tried setting Resources servlet init property and it partly works. All urls are now written with this resources prefix at the front (like /console/VAADIN/*), but still vaadin does not recognize it as a static resource type.
AbstractApplicationServlet code indicates that the resource type is resolved to static if requestUrl starts with /VAADIN so it does not match /console/VAADIN. Tried to override the protected method that resolves this resource type but it seems that the inner class wich is returned is private.
So, I'm stuck. But thanks for the tip anyway :-)