dev@grizzly.java.net

Re: OSGi Http Service: Overlapping registration issue

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Thu, 12 Feb 2009 11:02:07 +0100

Hi Hubert,

it's good question. I'm even not sure if Tomcat or Glassfish process
such requests correctly.
Does OSGi spec requires such a behavior just for index.html or for any
static/dynamic resource?

Thanks.

WBR,
Alexey.


On Feb 12, 2009, at 0:36 , Hubert Iwaniuk wrote:

> 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