public class OmniViewHandler extends ViewHandlerWrapper
RestorableViewHandler
.
This view handler performs the following tasks:
EnableRestorableView
tag is in the metadata. This effectively
prevents the ViewExpiredException
on the view.
ViewScoped
beans. This will create a dummy view and only
restore the view scoped state instead of building and restoring the entire view.
IllegalStateException
when there's a nested
UIForm
component.
ViewResourceHandler.isViewResourceRequest(FacesContext)
is true
, then
replace the HTML response writer with a XML response writer in renderView(FacesContext, UIViewRoot)
, and
ensure that proper action URL is returned in ViewHandlerWrapper.getActionURL(FacesContext, String)
.
EnableRestorableView
,
ViewScopeManager
CHARACTER_ENCODING_KEY, DEFAULT_FACELETS_SUFFIX, DEFAULT_SUFFIX, DEFAULT_SUFFIX_PARAM_NAME, DISABLE_FACELET_JSF_VIEWHANDLER_PARAM_NAME, FACELETS_BUFFER_SIZE_PARAM_NAME, FACELETS_DECORATORS_PARAM_NAME, FACELETS_LIBRARIES_PARAM_NAME, FACELETS_REFRESH_PERIOD_PARAM_NAME, FACELETS_SKIP_COMMENTS_PARAM_NAME, FACELETS_SUFFIX_PARAM_NAME, FACELETS_VIEW_MAPPINGS_PARAM_NAME
Constructor and Description |
---|
OmniViewHandler(ViewHandler wrapped)
Construct a new OmniFaces view handler around the given wrapped view handler.
|
Modifier and Type | Method and Description |
---|---|
void |
renderView(FacesContext context,
UIViewRoot viewToRender) |
UIViewRoot |
restoreView(FacesContext context,
String viewId)
If the current request is an unload request from
ViewScoped , then create a dummy view, restore only the
view root state and then immediately explicitly destroy the view, else restore the view as usual. |
addProtectedView, calculateCharacterEncoding, calculateLocale, calculateRenderKitId, createView, deriveLogicalViewId, deriveViewId, getActionURL, getBookmarkableURL, getProtectedViewsUnmodifiable, getRedirectURL, getResourceURL, getViewDeclarationLanguage, getViews, getViews, getWebsocketURL, getWrapped, initView, removeProtectedView, writeState
public OmniViewHandler(ViewHandler wrapped)
wrapped
- The wrapped view handler.public UIViewRoot restoreView(FacesContext context, String viewId)
ViewScoped
, then create a dummy view, restore only the
view root state and then immediately explicitly destroy the view, else restore the view as usual. If the
<o:enableRestoreView>
is used once in the application, and the restored view is null and the
current request is a postback, then recreate and rebuild the view from scratch. If it indeed contains the
<o:enableRestoreView>
, then return the newly created view, else return null
.restoreView
in class ViewHandlerWrapper
public void renderView(FacesContext context, UIViewRoot viewToRender) throws IOException
renderView
in class ViewHandlerWrapper
IOException
Copyright © 2012–2022 OmniFaces. All rights reserved.