public class EnableRestorableView extends TagHandler
<o:enableRestorableView> instructs the view handler to recreate the entire view whenever the
view has been expired, i.e. whenever
ViewHandler.restoreView(FacesContext, String) returns
and the current request is a postback. This effectively prevents
ViewExpiredException on the view. This tag
needs to be placed in
<f:metadata> of the view.
There are however technical design limitations: the recreated view is exactly the same as during the initial request, so any modifications which are made thereafter, either by taghandlers or conditionally rendered components based on some view or even session scoped variables, are completely lost. In order to recreate exactly the desired view, you would need to make sure that those modifications are made based on request scoped variables (read: request parameters) instead of view or session scoped variables. In other words, the state of the restorable view should not depend on view or session scoped managed beans, but purely on request scoped managed beans.
To enable the restorable view, just add the
<enableRestorableView> to the view metadata.
<f:metadata> <o:enableRestorableView/> </f:metadata>
|Constructor and Description|
The tag constructor.
|Modifier and Type||Method and Description|
Enable the current view to be restorable.
getAttribute, getRequiredAttribute, toString
public EnableRestorableView(TagConfig config)
config- The tag config.
public void apply(FaceletContext context, UIComponent parent) throws IOException
RestorableViewHandlercould intercept on.