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
-- 
M.Sc. Thomas Driessen
Software Methodologies for Distributed Systems
Institute of Computer Science
University of Augsburg
Universitätsstr. 6a
86135 Augsburg, Germany

Tel:    +49 821 598-2486
email: thomas.dries...@informatik.uni-augsburg.de

Reply via email to