[
https://issues.apache.org/jira/browse/WICKET-5486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Sven Ludwig updated WICKET-5486:
--------------------------------
Attachment:
fix-WICKET-5486-Wicket_7-shouldPreserveClientUrl_now_overruled_by_ALWAYS_REDIRECT.patch
Patch for Wicket 7.x with a new test case in WebPageRendererTest that breaks if
shouldPreserveClientUrl is not overruled by ALWAYS_REDIRECT.
This patch also includes the change to WebPageRenderer contained in isolated
form in fix-WICKET-5486-Wicket_7-shouldPreserveClientUrl_only.patch attachment.
In this patch here I also adjusted the expected outcomes in
WebPageRendererTest.testShouldRenderPageAndWriteResponseVariation(). Thereby I
looked closely at each variation for which I had to adjust its expected outcome
to validate the proposed change.
Please consider that the setResponsePage(Class) and setResponsePage(Class,
PageParameters) convenience methods in the Wicket API (in RequestCycle and
Component) internally use RedirectPolicy.ALWAYS_REDIRECT. I currently do not
see a problem here with respect to WICKET-3551 since the forward to a web.xml
error page would be performed by the container and not via setResponsePage.
> WebPageRenderer should honor RedirectPolicy.ALWAYS_REDIRECT more consistently
> -----------------------------------------------------------------------------
>
> Key: WICKET-5486
> URL: https://issues.apache.org/jira/browse/WICKET-5486
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 6.13.0, 7.0.0
> Reporter: Sven Ludwig
> Assignee: Martin Grigorov
> Priority: Minor
> Labels: contract, unexpected
> Fix For: 6.14.0
>
> Attachments:
> fix-WICKET-5486-Wicket_6-regarding_shouldPreserveClientUrl_only.patch,
> fix-WICKET-5486-Wicket_7-shouldPreserveClientUrl_now_overruled_by_ALWAYS_REDIRECT.patch,
> fix-WICKET-5486-Wicket_7-shouldPreserveClientUrl_only.patch
>
>
> In WebPageRenderer shouldPreserveClientUrl() currently has precedence over
> RedirectPolicy.ALWAYS_REDIRECT.
> This can lead to confusion or unexpected behavior when
> RedirectPolicy.ALWAYS_REDIRECT is explicitely set, but for some reason
> shouldPreserveClientUrl() returns true and thus no redirect is performed due
> to the logic in WebPageRenderer.
> A fix for this particular problem could be implemented in
> WebPageRenderer as of Wicket 6.12.0 by changing line 211 to:
> || (shouldPreserveClientUrl && getRedirectPolicy() !=
> RedirectPolicy.ALWAYS_REDIRECT)) //
> Note that this problem is slightly related to WICKET-5484. Both fixes
> combined the line could look like this:
> || (shouldPreserveClientUrl && !isAjax && getRedirectPolicy()
> != RedirectPolicy.ALWAYS_REDIRECT)) //
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)