Casting is bad, but as RedirectResolver is the result of adapting a resource, the implementation has access to the resource already. So no need for SlingHttpServletRequest or casting etc.

Regards
Carsten

On 31.01.2020 01:59, Ian Boston wrote:
Hi,
NO_REDIRECT, good point, added.

I think HttpServletRequest is better as it is wider.
If an implementation of a RedirectResolver requires SlingHttpServletRequest
it can check for that and cast to it, returning NO_REDIRECT if the context
isn't what it required.

Best Regards
Ian


On Fri, 31 Jan 2020 at 08:49, Bertrand Delacretaz <bdelacre...@apache.org>
wrote:

Hi,

On Fri, Jan 31, 2020 at 9:11 AM Ian Boston <i...@tfd.co.uk> wrote:
..
1 https://gist.github.com/ieb/5f217e2c160afb7bb4098bca99896621
...

The RedirectResolver gets an HttpServletRequest, shouldn't that be a
SlingHttpServletRequest to be able to get at the Resource, selectors
etc?

I understand the Resource can come from having used adaptTo before,
but other request attributes might influence the redirect and we have
them already parsed in SlingHttpServletRequest.

And a nitpick, in RedirectResponse I would make -1 a constant, NO_REDIRECT.

-Bertrand



--
--
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org

Reply via email to