You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Felix Meschberger <fm...@gmail.com> on 2010/04/26 16:41:39 UTC

Re: Getting Resolved files

Hi,

[Switching to dev@]

On 26.04.2010 08:51, Vidar Ramdal wrote:
>> On 23.04.2010 21:20, Jason Chen wrote:
>>> Hi everyone,
>>>
>>> I just recently started using Sling so I have a few questions that I have to
>>> ask.
>>>
>>> Is it possible for curl to specify a MIME type and have Sling resolve the
>>> file for me when I choose to GET it?
>>>
>>> For example,
>>> I have a html page at http://localhost:8080/content/mynode/testing.html
>>>
>>> If I were to ask curl to get a file of mime type text/html, and specify the
>>> url to be at http://localhost:8080/content/mynode/testing, will Sling know
>>> that I am talking about testing.html?
> 
> On Mon, Apr 26, 2010 at 9:07 AM, Felix Meschberger <fm...@gmail.com> wrote:
>> I assume you specify the text/html requested MIME type in the Accept
>> request header ?
>>
>> No, support for the Accept header to resolve a request's resource is not
>> implemented at the moment.
> 
> That said, it should be quite easy to write a servlet to do that resolution.
> The servlet would hold a map of MIME types and corresponding
> extensions ("text/html" => ".html"), and use that map to forward
> requests to the correct script.

Yes, or enhance the resource resolver to account for the Accept header
if there is no extension.

Regards
Felix