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 :slight_smile:

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

Location of VAADIN folder Resources /console

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 :slight_smile: