[ 
https://issues.apache.org/jira/browse/SLING-547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610547#action_12610547
 ] 

Felix Meschberger commented on SLING-547:
-----------------------------------------

I assume you request for /content/something.html where /content/something is 
the resource. Now, if you include /content/include/header.html, the resource is 
properly resolved but the request extension is still "html". That is the 
default servlet still selects a renderer for the "html" extension.

This happens in the SlingRequestPathInfo.merge(RequestPathInfo) method of the 
engine module, where the RequestPathInfo is inherited from the request if the 
included resource has no "request extension".

There is no way currently, to overwrite this (unfortunately).

> Included header.html (node of type nt:file) through a script sling.include 
> uses HtmlRendererServlet instead of StreamRendererServlet
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-547
>                 URL: https://issues.apache.org/jira/browse/SLING-547
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting, Servlets Get
>    Affects Versions: Servlets Get 2.0.2, Scripting Core 2.0.2
>         Environment: Ubuntu 8.04, Java 1.6
>            Reporter: Bryce Ewing
>            Priority: Minor
>
> Hi,
> Well at least I think that this is a bug.  The ScriptHelper.include method 
> says that it includes the "output of another request" which I would have 
> thought meant that if I included "/content/include/header.html" this would do 
> the same thing as if I requested 
> http://localhost:8080/content/include/header.html.  In this case the 
> header.html file is a snippet of html that has been loaded as a file (i.e. 
> with type nt:file).  When I request the file directly as 
> http://localhost:8080/content/include/header.html I get the file streamed 
> directly using StreamRendererServlet, but from an include this instead uses 
> the extension from the original request (which was for a html rendered view 
> of a node) and then uses the HtmlRendererServlet.
> I would make a suggestion as to where a fix to this could be applied but got 
> myself a little bogged down in the details of this, not sure if something 
> like checking the node type, and if it is a file that already matches the 
> extension then stream it might work?  Or maybe a different request object 
> needs to be created for this "request".
> Cheers
> Bryce

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to