| Summary: | Add support for fragments to add static resources to web-bundles | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | Antoine Toulmé <antoine> |
| Component: | osgi | Assignee: | Hugues Malphettes <hmalphettes> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jetty-inbox |
| Version: | 7.4.1 | ||
| Target Milestone: | 7.2.x | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Antoine Toulmé
As far as I know there is no support in the web-bundle spec to to do this. It is however quite trivial to support this with Jetty. When the WebAppContext is built we would add some new locations for jetty to lookup static resources. Those locations would be computed from information read on the fragments hosted by the web-bundle. Add 2 new jetty specific headers: Jetty-WarFragmentFolderPath and Jetty-WarPatchFragmentFolderPath. Those headers are defined on a fragment that is hosted by a web-bundle. They define a path inside the bundle to a new location where static resources are looked up by jetty. Jetty-WarFragmentFolderPath's location is appended to the lookup path. Jetty-WarPatchFragmentFolderPath's location is added at the beginning of the lookup path effectively overriding the static resources of the web bundle that have the same path. Thanks Hugues, that sounds like exactly what I need! To spice this up a bit : how would you support the case where there are multiple fragments patching the same location ? What order would be used then ? The order in which the fragment bundles are loaded or iterated on is not really defined. The minimum we should do is to always have the same lookup path for a given web-bundles and its fragments. So at least we should define a natural order amongst all the paths contributed by the fragments. I don't think we should have an explicit way of defining the order in which the extra locations on the lookup path are added. I propose that we order the lookup path by their name inside each fragment and then by the fragment symbolic name. If someone wants to exploit this natural order to make sure a fragment's folder is in the last position of the lookup path he could use: Jetty-WarFragmentFolderPath: /zzzz_at_the_end_of_the_path And have the folder "zzzz_at_the_end_of_the_path" in the fragment to contain the static resources. Let me know! OK, that sounds deterministic enough. Good deal :) Fixed for 7.4.1 |