I do think there is a valid use case for Servlet 3.0 web fragments
that is different from OSGi fragments.

Suppose you have a web fragment F that is shared between two web
applications (WABs) A and B.

Using OSGi fragments, you can attach F to A or to B but not to both.

If web fragments were recognized, you could add Require-Bundle: F to
both A and B to use the fragment.

Of course that's a rather static relationship, but it's still better
than embedding copies of F into A and B.

Best regards,
Harald

2012/12/20 Achim Nierbeck <bcanh...@googlemail.com>:
> Well if you need to "extend" your war with additional Servlets you need to
> stick to the std. OSGi-Fragments cause only with those they are in the same
> context.
> Or you try to break it up into a std. osgi jar and register all Servlets via
> the WhiteBoard Extender using the same HttpContext which you need to
> register beforehand as a service also.
>
> regards, Achim
>
>
> 2012/12/20 Matt Brozowski <bro...@opennms.org>
>>
>> Yeah I've been using Vaadin for some time and have a nice single page
>> application that extends itself in a similar way.
>>
>> I have an existing (very large) application that has a war for the web UI.
>> I am trying to break it up into modules where each piece of the app adds a
>> set of servlets / web pages for GUI and configuration but the entire thing
>> currently is built under a single contextPath.  I was trying to determine if
>> there was a nice way for me to effectively have 'sub-wars' for each module
>> and let them all register themselves under a the main context path.
>>
>> Matt
>>
>> On Dec 19, 2012, at 5:56 PM, Achim Nierbeck <bcanh...@googlemail.com>
>> wrote:
>>
>> Fragments do behave like usual bundles you just can't start them cause
>> they are attached to a host and need to be found by the host.
>> But yes you are right for the host bundle to realize the fragment is gone
>> it needs to be refreshed / restarted.
>> Though for those kind of dynamics I'd prefer using a OSGi service, that is
>> a far better approach for dynamics and plugin behavior,
>> especially the whiteboard extender is best to be used for a "plugin"
>> architecture.
>>
>> My first Vaadin Demo that got me to creating the pax-for-vaadin project
>> uses services for it's dynamics, it can be found at [1].
>>
>> regards, Achim
>>
>> [1] - https://github.com/ANierbeck/osgi-vaadin-demo
>>
>>
>> 2012/12/19 Matt Brozowski <bro...@opennms.org>
>>>
>>> I don't a great deal about fragments… but I was under the impression that
>>> you couldn't uninstall them and have their references go away.
>>>
>>> Doesn't that mean I would have to restart the entire webapp if I wanted
>>> to uninstall a plugin?  So no way to dynamically add/remove these?
>>>
>>> Matt
>>>
>>> On Dec 19, 2012, at 5:45 PM, Achim Nierbeck <bcanh...@googlemail.com>
>>> wrote:
>>>
>>> Hi Matt,
>>>
>>> nope pax-web doesn't support this yet, and in a osgi context I don't
>>> think it's needed. You can attach your osgi-fragment to a web-application
>>> and this will be as if it's the same web-application. :)
>>>
>>> regards, Achim
>>>
>>>
>>> 2012/12/19 Matt Brozowski <bro...@opennms.org>
>>>>
>>>> Does any of the pax-web infrastructure support web fragments?  I would
>>>> like to be able to add 'web app plugins' the extends my basic web app by
>>>> adding bundles with <web-fragment> information
>>>>

_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to