Details
-
Type: New Feature
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.1
-
Fix Version/s: 3.1.0.BETA1, 3.1
-
Component/s: Framework
-
Labels:None
-
Environment:ICEfaces
-
Assignee Priority:P1
-
Affects:Documentation (User Guide, Ref. Guide, etc.)
Description
PersistentFaces.State.redirectTo() allows a redirect to be pushed to the browser, but ICEfaces 2.0 PushRenderer does not provide this feature.
It should be possible to implement this with no bridge, core, or ICEpush modifications:
On pages that support redirection:
<ice:redirect href="#
{bean.redirectLocation}" />
If href is not null or empty, the redirect component adds an exec navigator.location=href to the partial response and invokes responseComplete(). This can be used when invoked via push or via a user interaction.
The "trick" in using this technique is to store the href so that it is accessible during rendering. Since a typical use case would be to trigger a redirect in one session from another, the method required would be to store the href in the application database, then invoke PushRenderer.render(). Another common case would be a redirect triggered via push after a long-running process. In that case, the completion of the long-running process can set the href and store it along with the completion status of the process.