Also, you might want to have a look at our documentation: http://felix.apache.org/site/launching-and-embedding-apache-felix.html
that should give you some ideas of doing it manually. regards, Karl On 11/9/07, Felix Meschberger <[EMAIL PROTECTED]> wrote: > Hi Thierry, > > You might want to have a look at the Equinox in a Servlet Container page > [1], though this is Equinox specific, you might get the points. > > > Alternatively, you might look at the Apache Sling, specifically the > Sling Web App project at [2] (we are currently refactoring the Sling > project, so the web app might not compile, but you will get the point). > The nice thing about the Sling web app is, that it really uses Felix as > the OSGi container. > > Hope this helps. > > Regards > Felix > > [1] http://www.eclipse.org/equinox/server/http_in_container.php > [2] > http://svn.apache.org/repos/asf/incubator/sling/trunk/launcher/webapp/ > > > Am Freitag, den 09.11.2007, 14:51 +0100 schrieb Thierry Templier: > > Hello, > > > > I try to use felix embedded in a web application and > > to develop a bundle that contains several web > > resources (servlets and jsp). > > > > I uses the http service described in OSGi and the > > ServiceTracker in order to register my web resources > > in the http service with the following class (class > > called by the activator of my bundle): > > > > public class HttpServiceTracker extends ServiceTracker > > { > > > > public HttpServiceTracker(BundleContext context) { > > super(context, HttpService.class.getName(), > > null); > > } > > > > public Object addingService(ServiceReference > > reference) { > > HttpService httpService = (HttpService) > > context.getService(reference); > > try { > > httpService.registerResources( > > "/myservlet", > > "/WebContent", null); > > httpService.registerServlet( > > "/myservlet/hello", > > new MyServlet(), > > null, null); > > } catch (Exception e) { > > e.printStackTrace(); > > } > > return httpService; > > } > > > > public void removedService(ServiceReference > > reference, Object service) { > > HttpService httpService = (HttpService) > > service; > > httpService.unregister("/myservlet"); > > httpService.unregister( > > "/myservlet/hello"); > > super.removedService(reference, service); > > } > > } > > > > I want that my felix container was embedded in a web > > application and not a jetty (or other) was embedded in > > felix. > > In this case, I don't know how to allow my web > > container to forward the request to the osgi http > > service in order to execute the servlets cointained in > > a bundle. > > > > Can you help me to solve this issue or to give me some > > adresses to some resources (documentation or howto) on > > the web? > > > > Thanks, > > Thierry > > > > Take a look at my blog: > > http://jroller.com/page/Templth/ > > (old: http://templth.blogspot.com/) > > > > > > > > _____________________________________________________________________________ > > Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Karl Pauls [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

