dev@grizzly.java.net

OSGi Http Service: Overlapping registration issue

From: Hubert Iwaniuk <neotyk_at_kungfoo.pl>
Date: Thu, 12 Feb 2009 00:36:00 +0100

Hi All,

This is follow up from conf call.

Assuming that bundle using Http Service has /2/index.html in it.
Same bundle registers two resources:
a) /1/2 mapped to root of bundle
b) /1 mapped to root of bundle

OSGi spec requires Http Service to process request for /1/2/index.html as
following:
i) check if registration /1/2 finds /index.html, if yes serve it, else ii)
ii) check if registration /1 finds /2/index.html, if yes serve it, else
(since '/' has not been registered) 404

In OSGiResourceAdapter [1] in method service() line 110 I try to make sure
that i) asks GWS to execute ii) by calling response.setStatus(404) I have no
luck with this approach.

How should I report to GWS that adapter haven't found resource but GWS
should check other possible solutions.

Thanks in advance,
   Hubert.

[1]
https://grizzly.dev.java.net/source/browse/grizzly/trunk/contribs/grizzly-httpservice/src/main/java/com/sun/grizzly/osgi/httpservice/OSGiResourceAdapter.java?rev=2464&view=markup