Hi,

In Rev. 618697 [0]the following main chaines are introduced:

(1) Replace SlingScriptHelper.include(String path,
RequestDispatcherOptions options) signature by
SlingScriptHelper.include(String path, String options).

(2) The implementation of the include method uses a request attribute to
hand over the RequestDispatcherOptions, because there is a
RequestDispatcher getter for Resource and RequestDispatcherOptions but
not a getter for String and RequestDispatcherOptions

(3) SlingRequestDispatcher.include cuts off extensions (duplicating
ResourceResolver.resolve() code) and causes errors, which should not be
caused.


I would like to propose to change this as follows:


(1) I do not understand the reason to change the method signature and
further more I do not understand why a special option (resource type
override) should be special and treated as default. I would like to
revert that change.


(2) Instead of using a request attribute to hand over the
RequestDispatcherOptions, I suggest the addition of a
SlingHttpServletRequest method:

         RequestDispatcher getRequestDispatcher(String path,
                     RequestDispatcherOptions options);



(3) Instead of cutting off extensions and calling
ResourceResolver.getResource, the include method should just call
ResourceResolver.resource(String path) method, which applies the exact
same algorithm as ResourceResolver.resolve(HttpServletRequest) - except
that the former returns null if the resource cannot be found. This
avoids duplicate code. And of course, the include method should just log
problematic situations, end do nothing instead of throwing (if the
response object has the wrong type) or sending an error (if no resource
can be found).


WDYT ?

Regards
Felix

[0] http://svn.apache.org/viewvc?view=rev&revision=618697
[1] http://issues.apache.org/jira/browse/SLING-221
[2] http://issues.apache.org/jira/browse/SLING-222


Reply via email to