Needed to add a check for Portlet mode before calling ViewHandler.initView

This commit is contained in:
Jeremy Grelle
2008-04-02 19:52:07 +00:00
parent f5ef7ea885
commit 3842ea242c
3 changed files with 6 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ public class JsfView extends AbstractUrlBasedView {
ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
if (JsfUtils.isAtLeastJsf12()) {
if (JsfUtils.isAtLeastJsf12() && !JsfUtils.isPortlet(facesContext)) {
viewHandler.initView(facesContext);
}

View File

@@ -82,4 +82,8 @@ public class JsfUtils {
public static boolean isAtLeastJsf12() {
return JSF_12;
}
public static boolean isPortlet(FacesContext context) {
return context.getExternalContext().getContext().getClass().getName().contains("Portlet");
}
}

View File

@@ -78,7 +78,7 @@ public class JsfViewFactory implements ViewFactory {
String viewName = resolveViewName(context);
ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
if (JsfUtils.isAtLeastJsf12()) {
if (JsfUtils.isAtLeastJsf12() && !JsfUtils.isPortlet(facesContext)) {
viewHandler.initView(facesContext);
}