I've created FELIX-4904 to track this

Carsten

Am 23.05.15 um 12:25 schrieb Carsten Ziegeler:
> Hi Thomas,
> 
> right now, the http service part and the http whiteboard part use
> different servlet contexts. That's why a filter registered through one
> way does not apply to servlets registered the other way.
> The semantics of the context handling between those two solutions is
> slightly different and mixing them in one context creates some problems.
> Afaik, other implementations of the http whiteboard do the same and keep
> things separate. And by separate it means that the default context of
> the http service is not the same context as the default context of the
> http whiteboard service.
> 
> Now, each whiteboard service can specify a "select" property to select
> the contexts it applies to, by default this is the default context of
> the whiteboard service. This is an LDAP filter expression where you can
> specify "select all contexts". We can argue that in this case it should
> also apply to the default context of the http service - right now, it
> doesn't but I guess this would be valuable addition. However, this part
> is not handled by the spec, so you bind yourself to a particular
> implementation atm.
> 
> 
> Carsten
> 
> Am 22.05.15 um 12:50 schrieb Thomas Driessen:
>> Hi again,
>>
>> I have two Servlets and one Filter.
>> The first servlet is registrated via whiteboard like this:
>>
>> @Component(properties={
>> @Property(name="osgi.http.whiteboard.servlet.name", value="MyServlet"),
>> @Property(name="osgi.http.whiteboard.servlet.pattern", value="/testone")})
>> public class MyWhiteboardServlet implements Servlet {
>> ...
>>
>> The second Servlet is registrated directly via HttpService like this:
>>
>> @Component
>> public class MyManualServlet implements Servlet {
>>  @ServiceDependency
>> private volatile HttpService httpService;
>>  @Start
>> public void start(){
>> try {
>> httpService.registerServlet("/testtwo", this, null, null);
>> } catch (ServletException e) {
>> e.printStackTrace();
>> } catch (NamespaceException e) {
>> e.printStackTrace();
>> }
>> }
>> ...
>>
>> Then I added a Filter also via whiteboard registration like this:
>>
>> @Component(properties={
>> @Property(name="osgi.http.whiteboard.filter.name", value="MyFilter"),
>> @Property(name="osgi.http.whiteboard.filter.pattern", value="/*")})
>> public class MyFilter implements Filter {
>> ...
>>
>> Everythings starts up fine, but when it comes to requests, only the
>> "MyWhiteboardServlet" is filtered correctly. When I try to access the
>> "MyManualServlet" nothing happens and the Filter is not invoked.
>>
>> Is this an intended behaviour?
>>
>> I know I'm mixing up different registration styles, but I assumed, that
>> internally both are registered the same way?
>> In my current project I'm forced to support both styles, as some third
>> party libraries I use, are using the direct registration, while others use
>> the whiteboard registration.
>>
>> Any advice on this problem is appreciated :)
>>
>> Best regards,
>> Thomas
>>
> 
> 


-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to