On Thu, Jan 19, 2012 at 8:09 AM, Cristiano Gavião <[email protected]> wrote: > Hi Hugues, > > Hummm, ok. Thanks for answer. > > I would, but first I need to evaluate if a web-bundle gives me all the > flexibility that I have today using a bundle where I can control almost > everything. > > Being more specific, could a web-bundle give me the plugability that is > described here: http://www.toedter.com/blog/?p=412 ?
I understand that what you are after is: <quote> Provide Bundles that contribute directly to the web application’s UI Just starting and stopping bundles should contribute/remove UI elements and functionality </quote> Just like Glassfish Jetty support web-fragments in OSGi and just like Glassfish this is not dynamic: you would need to restart the webapp to discover the newly enabled fragments. There are many ways to tackle the problem you describe and it sounds like you have a specific implementation in mind. I would make a dispatcher servlet in a web-bundle or hosted by the HttpService. Then I would use an OSGi service listener or a BundleListenerr to register/unregister new contributions onto the dispatcher servlet. If you want you can extend the HttpServletBridge which is the servlet that hosts the HttpService. This is the bundle where we host the org.eclipse.equinox.http.servlet.HttpServiceServlet which provides the HttpService: http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-osgi/jetty-osgi-httpservice/contexts/httpservice.xml When the bundle org.eclipse.jetty.osgi.httpservice is activated the HttpService becomes available. You can make a similar bundle or fork this one and extend the HttpService there. The best would be to convince equinox to adopt your enhancement. I hope this helps, Hugues > > cheers > > Cristiano > > > > On 18/01/12 20:44, Hugues Malphettes wrote: >> >> Hi Cristiano, >> >> On Thu, Jan 19, 2012 at 3:21 AM, Cristiano Gavião<[email protected]> >> wrote: >>> >>> Hi, >>> >>> OSGi HTTP doesn't give to use the ability to register Filters. So for >>> this I >>> used to work with org.eclipse.equinox.http.servlet.ExtendedHttpService >>> from >>> Equinox to build my embeded webserver application. >>> >>> But with this API doesn't supply any easy way to register Servlet >>> Listener >>> as the ones that exists in web.xml. >>> >>> Jetty project has any API for this? >> >> We have not been further than hosting the HttpService provided by Equinox. >> How about using a web-bundle to get support for the whole servlet spec? >> Hugues >> >>> regards >>> >>> Cristiano >>> >>> >>> >>> _______________________________________________ >>> jetty-users mailing list >>> [email protected] >>> https://dev.eclipse.org/mailman/listinfo/jetty-users >>> >> _______________________________________________ >> jetty-users mailing list >> [email protected] >> https://dev.eclipse.org/mailman/listinfo/jetty-users > > _______________________________________________ jetty-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/jetty-users
