Hi all, This has now been implemented for SLING-723 [1] in Revision 724385 of Sling trunk.
Regards Felix [1] https://issues.apache.org/jira/browse/SLING-723 Felix Meschberger schrieb: > Hi all, > > I have prepared an implementation for the StreamRendering for the > DefaultGetServlet now, which is slightly different to the proposal: > > * If the request has a suffix which is a sling slash (that is the > request URL is terminated by a slash), directory indexing is called: > > * If there is child resource as listed in the index.files > configuration property, that child resource is included as > the directory index. This corresponds to the DirectoryIndex > directive of httpd. > * Otherwise if the index configuration property is set to > true an automatic directory index is rendered. This > corresponds to the "Index" option of the Options directive > of httpd. > * Otherwise if neither a listed child resource exists nor > the index property is set to true, the request is forbidden > (status 403/FORBIDDEN). > > Default is index.files=["index","index.html"] and index=true > > * Otherwise (request has no trailing slash), if the resource > requested resource adapts to an InputStream, that stream is just > spooled to the client. > > * Otherwise (no InputStream and no trailing slash), a redirect to > the same URL with a trailing slash appended is sent to the client > to get a directory listing to client. > > Regards > Felix > > Alexander Klimetschek schrieb: >> On Fri, Dec 5, 2008 at 11:45 AM, Felix Meschberger <[EMAIL PROTECTED]> wrote: >>> The StreamHandlerServlet tries to stream the resource if it adapts to an >>> InputStream (as it does now). If the resource does not adapt to a >>> stream, the following steps are taken: >>> >>> * if the request URL is not terminated with a slash redirect >>> to the same URL with a terminating slash >>> * if the resource has a child resource "index" or "index.html" >>> (configurable) name, that resource is included ensuring an >>> extension is set (defaulting to .html). This would be the >>> analogon to the httpd "DirectoryIndex" directive >>> * finally a child resource list is built similar to the >>> httpd "Options Index" directive. >>> >>> Likewise, the default renderers for .html and .txt might also be >>> modified. Yet, I am not sure, what to do here: On the one hand it is >>> very practical to have the resource dump (to help finding errors) and on >>> the other hand, this is a very uncool behaviour in a publishing >>> environment. What I could imagine would be to have a configuration >>> option, which may switch behaviour between "dump the properties" and >>> "send 404/NOT FOUND or 403/FORBIDDEN". We might even make the status >>> code configurable. >> Sounds good to me! >> >> Regards, >> Alex >> >
