osgi/bugzilla-archive

[http whiteboard] Clarify intent of test case ServletTestCase.testHttpServiceAndErrorPage

Closed this issue · 4 comments

Original bug ID: BZ#3114
From: @rotty3000
Reported version: R7

Comment author: @rotty3000

Test Case

org.osgi.test.cases.http.whiteboard.junit.ServletTestCase.testHttpServiceAndErrorPage()

The method comment is:

/**

  • Registration of error page with http service (allowed) and error page and
  • pattern with http service (not allowed)
    */
    public void testHttpServiceAndErrorPage() throws Exception {

Which seems to make sure that this case is not supported.

However the R7 spec states in section 140.4.2, P5:

While not being common practice, it is possible to combine the
osgi.http.whiteboard.servlet.errorPage and osgi.http.whiteboard.servlet.pattern
properties. If a single servlet registration has both these registration
properties it is considered both an ordinary servlet as well as an error page.

Comment author: @cziegeler

The key here is "with the http service". We don't allow registering servlets through the whiteboard with the context(s) managed by the http service.

Comment author: @rotty3000

The relevant section is 140.10 P5:

Association with Http Context from the Http Service can only be done for
servlet filters, error pages and listeners. Servlets and resources cannot be
associated with Http Contexts managed by the Http Service. If this is attempted
this will be reflected in the failure DTOs.

Comment author: @rotty3000

Clarified by Carsten