New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure that static web resources are available in OSGi #4230
Comments
This is kind of blocked by the #4227 but it doesn't have to wait when the task will be completely done (and merged). |
I have some issues with static resources right now. For the automation tests task I modified root-context tests so that it's OSGi bundle (including UI classes only) : it's a jar file ( There is So I configured the So as a result servlet context which is used to get the resource in the end doesn't know about static resources inside OK, may be it's how it's supposed to work. But we are using servlet context to get resource content by path inside template parser ( And since the servlet context knows nothing about static resources it returns So it's not enough to expose static resources via HTTP but they also should be available via servlet context (or we need to change our code somehow). To be able to solve this issue I added also resources from the In the resulting configuration Jetty allows to get resources from the bundle jar and now resources becomes available by their correct path (previously path But this may be a result of main servlet mapping which is not mapped to the I will keep it for now for tests but once this ticket is fixed we should adjust tests accordingly. |
I'm not sure, but I think in my old Vaadin8 integration I had a similar problem. The The The code is unfortunately in written in Xtend but not so different from Java, so I hope it's readable. I hope this helps. |
Thank you for the examples. But in fact this is already done almost in the same way in our tests. The problem is different.
As I mentioned in the comment : we have |
Ok I got it. I mistook If the If I'm still getting you wrong, then just ignore this comment. I'm not that deep into Servlets and web stuff as you probably are ;) |
A good example in using Vaadin in an OSGi environment can be found at https://github.com/opensecuritycontroller/osc-core/tree/master/osc-ui/src/main/java/org/osc/core/ui |
Thank you for the reference. I will look into this. |
Regarding to my issue with our In reality the web context path is So there is no issue with the static resource in a WAB file. But that works only for the resources inside the WAB itself. |
As discussed, the component related static resources should be made available this way. But we still need some resources like templates, web component files related to theming; available on the servlet context. We will first take #4671, fix #4376, create more tests for OSGi (no issue yet) and then we will validate that this works out-of-the-box as it should. |
This is similar to #4229 but the static web resources here are not handle by the VaadinServlet.
They are handled by the web server directly.
Those resources are
frontend
resources like CSS files, HTML files (template files) , JS files.Such files are plain web resources in the application and should be somehow exposed in OSGi.
There can be different ways to do this but it should be simple enough for the developer.
Similar things are done here mmerruko/framework@687a900 bt it might be this is not applicable at all here.
What needs to be done: create an application, deploy it to OSGi and make sure the static web resources are available there.
If the custom way to do this is too complicated or may be improved then provide a way which can be used to simplify this in OSGi environment (see mentioned commit in FW).
The text was updated successfully, but these errors were encountered: