HttpContext is an interface. Your extender can implement HttpContext and 
create an HttpContext instance which uses the bundle containing the 
resources so that HttpService can find them.
-- 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
[email protected]

office: +1 386 848 1781
mobile: +1 386 848 3788




From:
"Heiko Waldschmidt" <[email protected]>
To:
<[email protected]>
Date:
2009/08/24 09:34
Subject:
[osgi-dev] Extender Pattern + HttpContext Problem
Sent by:
[email protected]



Hello OSGi-Developers,

first I try to describe what I want to have and then my problem to code 
this.

One bundle (called registry) should provide the startpage of my GUI and a 
menu or navigation bar. The entries of this menu are generated dynamicaly 
in a jsp. The jsp generates one or more entry(s) for every bundle which 
includes a specific header (I use the Extender Pattern shown in 
http://www.aqute.biz/Snippets/Extender). In the menu every Entry is a 
html-link. If you klick on the link you can see a jsp/servlet html page or 
something other inside a frame next to the menu. What is shown in this 
frame is not included in the registry it is in the bundle (called BundleA 
from now on) we found the header entry.

No we are next to my Problem. The method in the registry to register a 
servlet which is part of BundleA is shown in 
http://www.aqute.biz/Snippets/Extender or file in the annex (method 
registerServlet).

The Method to register a jsp is very easy (show in the annex). But how can 
I register a html-page or a .jpg?

With - HttpService().registerResources(alias, name, null); - the 
httpService doesn't find my page. The problem is the third parameter of 
this method: the httpContext. If I want to create a httpContext in the 
registry there is only one method I know: 
HttpService.createDefaultHttpContext(). This httpContext this method 
creates is connected to the bundleContext of the bundle which calls it. If 
I call the method in the registry the httpContext is connected to it and 
the httpServices tries to find the html, .jpg etc. in the registry - but 
it's in the other bundle. How can I register a resource - which is not in 
my bundle - at the httpService if I want to use the extender pattern? I 
have some ideas, but if I use them it makes no sense to use the extender 
pattern too.

Greetings,
Heiko Waldschmidt

[attachment "Registry.java" deleted by BJ Hargrave/Austin/IBM] 
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to