dev@grizzly.java.net

Re: OSGi Http Service: Overlapping registration issue

From: Hubert Iwaniuk <neotyk_at_kungfoo.pl>
Date: Thu, 12 Feb 2009 11:38:41 +0100

Hi Alexey,
It requires such behavior for any static/dynamic resource.
Please take a look at [1] Chapter 102.4 Mapping HTTP Requests to Servlet and
Resource Registrations on p. 22 point 6 talks about this behavior.
As I saw with legacy algorithm in GWS it would work, I didn't quite
understood how Mapper does it.

Thanks,
   Hubert.

[1] http://www.osgi.org/Download/File?url=/download/r4v41/r4.cmpn.pdf


On Thu, Feb 12, 2009 at 11:02 AM, Oleksiy Stashok
<Oleksiy.Stashok_at_sun.com>wrote:

> 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
>
>