Class ViewHandlerImpl
@Deprecated public class ViewHandlerImpl extends ViewHandler
MultiViewHandler
This 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 Locale
calculateLocale(FacesContext context)
Deprecated.Returns an appropriateLocale
to use for this and subsequent requests for the current client.String
calculateRenderKitId(FacesContext context)
Deprecated.Return an appropriaterenderKitId
for this and subsequent requests from the current client.UIViewRoot
createView(FacesContext context, String viewId)
Deprecated.Create and return a newUIViewRoot
instance initialized with information from the argumentFacesContext
andviewId
.protected Locale
findMatch(FacesContext context, Locale pref)
Deprecated.Attempts to find a matching locale based onpref
and list of supported locales, using the matching algorithm as described in JSTL 8.3.2.String
getActionURL(FacesContext context, String viewId)
Deprecated.If the value returned from this method is used as thefile
argument 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 thatURL
will select the argumentviewId
for traversing the Jakarta Server Faces lifecycle.String
getResourceURL(FacesContext context, String path)
Deprecated.If the value returned from this method is used as thefile
argument 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 thatURL
will select the argumentpath
for direct rendering.String
getWebsocketURL(FacesContext context, String channel)
Deprecated.If the value returned from this method is used as thefile
argument 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 thatURL
will select the argumentchannel
for connecting the websocket push channel in the current view.void
initView(FacesContext context)
Deprecated.Do not call the default implementation ofViewHandler.initView(jakarta.faces.context.FacesContext)
if theExternalContext.getRequestCharacterEncoding()
returns anon-null
result.void
renderView(FacesContext context, UIViewRoot viewToRender)
Deprecated.Perform whatever actions are required to render the response view to the response object associated with the currentFacesContext
.UIViewRoot
restoreView(FacesContext context, String viewId)
Deprecated.Perform whatever actions are required to restore the view associated with the specifiedFacesContext
andviewId
.void
writeState(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-null
result.- Overrides:
initView
in classViewHandler
- Parameters:
context
- the Faces context.- Throws:
FacesException
- if a problem occurs setting the encoding, such as theUnsupportedEncodingException
thrown 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:ViewHandler
Perform 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
ViewDeclarationLanguage
for theviewId
of the argumentviewToRender
and 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:
renderView
in classViewHandler
- Parameters:
context
-FacesContext
for 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:ViewHandler
Perform whatever actions are required to restore the view associated with the specified
FacesContext
andviewId
. It may delegate to therestoreView
of the associatedStateManager
to 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
ViewDeclarationLanguage
for thisviewId
and 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:
restoreView
in classViewHandler
- Parameters:
context
-FacesContext
for the current requestviewId
- the view identifier for the current request- Returns:
- the restored view root, or null.
-
createView
Deprecated.Description copied from class:ViewHandler
Create and return a new
UIViewRoot
instance initialized with information from the argumentFacesContext
andviewId
. Locate theViewDeclarationLanguage
implementation for the VDL used in the view. The argumentviewId
must be converted to a physicalviewId
that can refer to an actual resource suitable for use by theViewDeclarationLanguage
ViewDeclarationLanguage.createView(jakarta.faces.context.FacesContext, java.lang.String)
, which must be called by this method.- Specified by:
createView
in classViewHandler
- Parameters:
context
- the Faces context.viewId
- the view id.- Returns:
- the viewroot.
-
calculateLocale
Deprecated.Description copied from class:ViewHandler
Returns an appropriate
Locale
to use for this and subsequent requests for the current client.- Specified by:
calculateLocale
in classViewHandler
- Parameters:
context
-FacesContext
for the current request- Returns:
- the locale.
-
calculateRenderKitId
Deprecated.Description copied from class:ViewHandler
Return an appropriate
renderKitId
for 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:
calculateRenderKitId
in classViewHandler
- Parameters:
context
-FacesContext
for the current request- Returns:
- the render kit id.
-
findMatch
Deprecated.Attempts to find a matching locale based onpref
and list of supported locales, using the matching algorithm as described in JSTL 8.3.2.- Parameters:
context
- theFacesContext
for 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:ViewHandler
Take 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
Ajax
request. When responding toAjax
requests, the state is obtained by callingStateManager.getViewState(jakarta.faces.context.FacesContext)
and then written into theAjax
response during final encoding (PartialViewContext.processPartial(jakarta.faces.event.PhaseId)
) .- Specified by:
writeState
in classViewHandler
- Parameters:
context
-FacesContext
for the current request- Throws:
IOException
- if an input/output error occurs
-
getActionURL
Deprecated.Description copied from class:ViewHandler
If the value returned from this method is used as the
file
argument 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 thatURL
will select the argumentviewId
for 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_PARAM
and 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:
getActionURL
in classViewHandler
- Parameters:
context
-FacesContext
for this requestviewId
- View identifier of the desired view- Returns:
- the action url.
-
getResourceURL
Deprecated.Description copied from class:ViewHandler
If the value returned from this method is used as the
file
argument 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 thatURL
will select the argumentpath
for 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:
getResourceURL
in classViewHandler
- Parameters:
context
-FacesContext
for the current requestpath
- Resource path to convert to a URL- Returns:
- the resource URL.
-
getWebsocketURL
Deprecated.Description copied from class:ViewHandler
If the value returned from this method is used as the
file
argument 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 thatURL
will select the argumentchannel
for connecting the websocket push channel in the current view. It must match thePushContext.URI_PREFIX
of the endpoint.- Specified by:
getWebsocketURL
in classViewHandler
- Parameters:
context
-FacesContext
for the current request.channel
- The channel name of the websocket.- Returns:
- the websocket URL.
- See Also:
PushContext.URI_PREFIX
-