dev@grizzly.java.net

Re: OSGi Http Service: Overlapping registration issue

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Thu, 12 Feb 2009 14:29:51 +0100

> 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.
Unfortunately link doesn't work for me :(

> As I saw with legacy algorithm in GWS it would work, I didn't quite
> understood how Mapper does it.
I'm really not sure GWS will work correctly with such requests. Think
Jeanfrancois should know this better.

Thanks.

WBR,
Alexey.

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