Class ViewHandlerImpl
@Deprecated public class ViewHandlerImpl extends ViewHandler
MultiViewHandlerThis is the default implementation for JSF 1.2.
While this class isn't used by the 2.0 runtime, it's kept for binary compatibility with those that extend from this class directly.
-
Field Summary
Fields inherited from class jakarta.faces.application.ViewHandler
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 Summary
Constructors Constructor Description ViewHandlerImpl()Deprecated. -
Method Summary
Modifier and Type Method Description LocalecalculateLocale(FacesContext context)Deprecated.Returns an appropriateLocaleto use for this and subsequent requests for the current client.StringcalculateRenderKitId(FacesContext context)Deprecated.Return an appropriaterenderKitIdfor this and subsequent requests from the current client.UIViewRootcreateView(FacesContext context, String viewId)Deprecated.Create and return a newUIViewRootinstance initialized with information from the argumentFacesContextandviewId.protected LocalefindMatch(FacesContext context, Locale pref)Deprecated.Attempts to find a matching locale based onprefand list of supported locales, using the matching algorithm as described in JSTL 8.3.2.StringgetActionURL(FacesContext context, String viewId)Deprecated.If the value returned from this method is used as thefileargument to the four-argument constructor forjava.net.URL(assuming appropriate values are used for the first three arguments), then a client making a request to thetoExternalForm()of thatURLwill select the argumentviewIdfor traversing the Jakarta Server Faces lifecycle.StringgetResourceURL(FacesContext context, String path)Deprecated.If the value returned from this method is used as thefileargument to the four-argument constructor forjava.net.URL(assuming appropriate values are used for the first three arguments), then a client making a request to thetoExternalForm()of thatURLwill select the argumentpathfor direct rendering.StringgetWebsocketURL(FacesContext context, String channel)Deprecated.If the value returned from this method is used as thefileargument to the four-argument constructor forjava.net.URL(assuming appropriate values are used for the first three arguments), then a client making a push handshake request to thetoExternalForm()of thatURLwill select the argumentchannelfor connecting the websocket push channel in the current view.voidinitView(FacesContext context)Deprecated.Do not call the default implementation ofViewHandler.initView(jakarta.faces.context.FacesContext)if theExternalContext.getRequestCharacterEncoding()returns anon-nullresult.voidrenderView(FacesContext context, UIViewRoot viewToRender)Deprecated.Perform whatever actions are required to render the response view to the response object associated with the currentFacesContext.UIViewRootrestoreView(FacesContext context, String viewId)Deprecated.Perform whatever actions are required to restore the view associated with the specifiedFacesContextandviewId.voidwriteState(FacesContext context)Deprecated.Take any appropriate action to either immediately write out the current state information (by callingStateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object), or noting where state information should later be written.Methods inherited from class jakarta.faces.application.ViewHandler
addProtectedView, calculateCharacterEncoding, deriveLogicalViewId, deriveViewId, getBookmarkableURL, getProtectedViewsUnmodifiable, getRedirectURL, getViewDeclarationLanguage, getViews, getViews, removeProtectedView
-
Constructor Details
-
ViewHandlerImpl
public ViewHandlerImpl()Deprecated.
-
-
Method Details
-
initView
Deprecated.Do not call the default implementation ofViewHandler.initView(jakarta.faces.context.FacesContext)if theExternalContext.getRequestCharacterEncoding()returns anon-nullresult.- Overrides:
initViewin classViewHandler- Parameters:
context- the Faces context.- Throws:
FacesException- if a problem occurs setting the encoding, such as theUnsupportedEncodingExceptionthrown by the underlying Jakarta Servlet or Portlet technology when the encoding is not supported.- See Also:
ViewHandler.initView(jakarta.faces.context.FacesContext)
-
renderView
public void renderView(FacesContext context, UIViewRoot viewToRender) throws IOException, FacesExceptionDeprecated.Description copied from class:ViewHandlerPerform whatever actions are required to render the response view to the response object associated with the current
FacesContext.Otherwise, the default implementation must obtain a reference to the
ViewDeclarationLanguagefor theviewIdof the argumentviewToRenderand call itsViewDeclarationLanguage.renderView(jakarta.faces.context.FacesContext, jakarta.faces.component.UIViewRoot)method, returning the result and not swallowing any exceptions thrown by that method.- Specified by:
renderViewin classViewHandler- Parameters:
context-FacesContextfor the current requestviewToRender- the view to render- Throws:
IOException- if an input/output error occursFacesException- if a Jakarta Servlet error occurs
-
restoreView
Deprecated.Description copied from class:ViewHandlerPerform whatever actions are required to restore the view associated with the specified
FacesContextandviewId. It may delegate to therestoreViewof the associatedStateManagerto do the actual work of restoring the view. If there is no available state for the specifiedviewId, returnnull.Otherwise, the default implementation must obtain a reference to the
ViewDeclarationLanguagefor thisviewIdand call itsViewDeclarationLanguage.restoreView(jakarta.faces.context.FacesContext, java.lang.String)method, returning the result and not swallowing any exceptions thrown by that method.- Specified by:
restoreViewin classViewHandler- Parameters:
context-FacesContextfor the current requestviewId- the view identifier for the current request- Returns:
- the restored view root, or null.
-
createView
Deprecated.Description copied from class:ViewHandlerCreate and return a new
UIViewRootinstance initialized with information from the argumentFacesContextandviewId. Locate theViewDeclarationLanguageimplementation for the VDL used in the view. The argumentviewIdmust be converted to a physicalviewIdthat can refer to an actual resource suitable for use by theViewDeclarationLanguageViewDeclarationLanguage.createView(jakarta.faces.context.FacesContext, java.lang.String), which must be called by this method.- Specified by:
createViewin classViewHandler- Parameters:
context- the Faces context.viewId- the view id.- Returns:
- the viewroot.
-
calculateLocale
Deprecated.Description copied from class:ViewHandlerReturns an appropriate
Localeto use for this and subsequent requests for the current client.- Specified by:
calculateLocalein classViewHandler- Parameters:
context-FacesContextfor the current request- Returns:
- the locale.
-
calculateRenderKitId
Deprecated.Description copied from class:ViewHandlerReturn an appropriate
renderKitIdfor this and subsequent requests from the current client. It is an error for this method to returnnull.The default return value is
RenderKitFactory.HTML_BASIC_RENDER_KIT.- Specified by:
calculateRenderKitIdin classViewHandler- Parameters:
context-FacesContextfor the current request- Returns:
- the render kit id.
-
findMatch
Deprecated.Attempts to find a matching locale based onprefand list of supported locales, using the matching algorithm as described in JSTL 8.3.2.- Parameters:
context- theFacesContextfor the current requestpref- the preferred locale- Returns:
- the Locale based on pref and the matching alogritm specified in JSTL 8.3.2
-
writeState
Deprecated.Description copied from class:ViewHandlerTake any appropriate action to either immediately write out the current state information (by calling
StateManager.writeState(jakarta.faces.context.FacesContext, java.lang.Object), or noting where state information should later be written.This method must do nothing if the current request is an
Ajaxrequest. When responding toAjaxrequests, the state is obtained by callingStateManager.getViewState(jakarta.faces.context.FacesContext)and then written into theAjaxresponse during final encoding (PartialViewContext.processPartial(jakarta.faces.event.PhaseId)) .- Specified by:
writeStatein classViewHandler- Parameters:
context-FacesContextfor the current request- Throws:
IOException- if an input/output error occurs
-
getActionURL
Deprecated.Description copied from class:ViewHandlerIf the value returned from this method is used as the
fileargument to the four-argument constructor forjava.net.URL(assuming appropriate values are used for the first three arguments), then a client making a request to thetoExternalForm()of thatURLwill select the argumentviewIdfor traversing the Jakarta Server Faces lifecycle. Please see section 7.6.2 for the complete specification, especially for details related to view protection using theResponseStateManager.NON_POSTBACK_VIEW_TOKEN_PARAMand the behavior when the current request is to a URL for which the FacesServlet has an exact mapping as defined by Servlet.12.2.- Specified by:
getActionURLin classViewHandler- Parameters:
context-FacesContextfor this requestviewId- View identifier of the desired view- Returns:
- the action url.
-
getResourceURL
Deprecated.Description copied from class:ViewHandlerIf the value returned from this method is used as the
fileargument to the four-argument constructor forjava.net.URL(assuming appropriate values are used for the first three arguments), then a client making a request to thetoExternalForm()of thatURLwill select the argumentpathfor direct rendering. If the specified path starts with a slash, it must be treated as context relative; otherwise, it must be treated as relative to the action URL of the current view.- Specified by:
getResourceURLin classViewHandler- Parameters:
context-FacesContextfor the current requestpath- Resource path to convert to a URL- Returns:
- the resource URL.
-
getWebsocketURL
Deprecated.Description copied from class:ViewHandlerIf the value returned from this method is used as the
fileargument to the four-argument constructor forjava.net.URL(assuming appropriate values are used for the first three arguments), then a client making a push handshake request to thetoExternalForm()of thatURLwill select the argumentchannelfor connecting the websocket push channel in the current view. It must match thePushContext.URI_PREFIXof the endpoint.- Specified by:
getWebsocketURLin classViewHandler- Parameters:
context-FacesContextfor the current request.channel- The channel name of the websocket.- Returns:
- the websocket URL.
- See Also:
PushContext.URI_PREFIX
-