Package org.springframework.faces.webflow

Examples of org.springframework.faces.webflow.FacesContextHelper


  public boolean supports(Object handler) {
    return handler instanceof JsfResourceRequest;
  }

  public ModelAndView handleResource(ResourceRequest request, ResourceResponse response, Object handler) throws IOException {
    FacesContextHelper helper = new FacesContextHelper();
    try {
      FacesContext facesContext = helper.getFacesContext(getPortletContext(), request, response);
      handleResourceRequest(facesContext, request, response);
    } finally {
      helper.releaseIfNecessary();
    }
    return null;
  }
View Full Code Here


  }

  protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request,
      HttpServletResponse response) throws Exception {

    FacesContextHelper facesContextHelper = new FacesContextHelper();
    FacesContext facesContext = facesContextHelper.getFacesContext(getServletContext(), request, response);

    populateRequestMap(facesContext, model);

    JsfUtils.notifyBeforeListeners(PhaseId.RESTORE_VIEW, this.facesLifecycle, facesContext);

    ViewHandler viewHandler = facesContext.getApplication().getViewHandler();

    if (!isPortletRequest(facesContext)) {
      viewHandler.initView(facesContext);
    }

    UIViewRoot viewRoot = viewHandler.createView(facesContext, getUrl());
    Assert.notNull(viewRoot, "A JSF view could not be created for " + getUrl());
    viewRoot.setLocale(RequestContextUtils.getLocale(request));
    viewRoot.setTransient(true);

    facesContext.setViewRoot(viewRoot);

    JsfUtils.notifyAfterListeners(PhaseId.RESTORE_VIEW, this.facesLifecycle, facesContext);

    facesContext.setViewRoot(viewRoot);
    facesContext.renderResponse();
    try {
      this.logger.debug("Asking faces lifecycle to render");
      this.facesLifecycle.render(facesContext);
    } finally {
      this.logger.debug("View rendering complete");
      facesContextHelper.releaseIfNecessary();
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.faces.webflow.FacesContextHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.