Skip to content

Commit

Permalink
Fixes issue #4486 - Remove legacy JSF 1.2 view handler support
Browse files Browse the repository at this point in the history
  • Loading branch information
manfredriem committed Oct 4, 2018
1 parent ed11c9a commit 0dc4f71
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 57 deletions.
8 changes: 0 additions & 8 deletions impl/src/main/java/com/sun/faces/config/WebConfiguration.java
Expand Up @@ -1262,14 +1262,6 @@ public enum BooleanWebContextInitParameter {
"com.sun.faces.enableLazyBeanValidation",
true
),
EnableLoadBundle11Compatibility(
"com.sun.faces.enabledLoadBundle11Compatibility",
false
),
EnableRestoreView11Compatibility(
"com.sun.faces.enableRestoreView11Compatibility",
false
),
SerializeServerState(
StateManager.SERIALIZE_SERVER_STATE_PARAM_NAME,
false
Expand Down
41 changes: 5 additions & 36 deletions impl/src/main/java/com/sun/faces/lifecycle/RestoreViewPhase.java
Expand Up @@ -179,21 +179,10 @@ public void execute(FacesContext facesContext) throws FacesException {
// try to restore the view
viewRoot = viewHandler.restoreView(facesContext, viewId);
if (viewRoot == null) {
if (is11CompatEnabled(facesContext)) {
// 1.1 -> create a new view and flag that the response should
// be immediately rendered
if (LOGGER.isLoggable(FINE)) {
LOGGER.fine("Postback: recreating a view for " + viewId);
}
viewRoot = viewHandler.createView(facesContext, viewId);
facesContext.renderResponse();

} else {
Object[] params = {viewId};
throw new ViewExpiredException(
getExceptionMessageString(RESTORE_VIEW_ERROR_MESSAGE_ID, params),
viewId);
}
Object[] params = {viewId};
throw new ViewExpiredException(
getExceptionMessageString(RESTORE_VIEW_ERROR_MESSAGE_ID, params),
viewId);
}

facesContext.setViewRoot(viewRoot);
Expand Down Expand Up @@ -507,24 +496,4 @@ private static boolean isErrorPage(FacesContext context) {
getRequestMap().get(WEBAPP_ERROR_PAGE_MARKER) != null);

}


private WebConfiguration getWebConfig(FacesContext context) {

if (webConfig == null) {
webConfig = WebConfiguration.getInstance(context.getExternalContext());
}
return webConfig;

}

private boolean is11CompatEnabled(FacesContext context) {

return (getWebConfig(context).isOptionEnabled(
BooleanWebContextInitParameter.EnableRestoreView11Compatibility));

}

// The testcase for this class is TestRestoreViewPhase.java

} // end of class RestoreViewPhase
}
13 changes: 0 additions & 13 deletions impl/src/main/java/javax/faces/application/ViewHandler.java
Expand Up @@ -214,19 +214,6 @@ public abstract class ViewHandler {
*/
public static final String FACELETS_DECORATORS_PARAM_NAME = "javax.faces.FACELETS_DECORATORS";

/**
* <p class="changed_modified_3_0">
* This constant is deprecated and is to be completely ignored by the JSF runtime.
* </p>
*
* @since 2.0
* @deprecated
*/
@Deprecated
public static final String DISABLE_FACELET_JSF_VIEWHANDLER_PARAM_NAME = "javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER";



// ---------------------------------------------------------- Public Methods

/**
Expand Down

0 comments on commit 0dc4f71

Please sign in to comment.