Examples of Flash


Examples of javax.faces.context.Flash

        {
            log.finest("entering " + executor.getPhase() + " in " + LifecycleImpl.class.getName());
        }

        PhaseId currentPhaseId = executor.getPhase();
        Flash flash = context.getExternalContext().getFlash();

        try
        {
            /*
             * Specification, section 2.2
             * The default request lifecycle processing implementation must ensure that the currentPhaseId property
             * of the FacesContext instance for this request is set with the proper PhaseId constant for the current
             * phase as the first instruction at the beginning of each phase
             */
            context.setCurrentPhaseId(currentPhaseId);
           
            flash.doPrePhaseActions(context);
           
            // let the PhaseExecutor do some pre-phase actions
            executor.doPrePhaseActions(context);

            phaseListenerMgr.informPhaseListenersBefore(currentPhaseId);

            if (isResponseComplete(context, currentPhaseId, true))
            {
                // have to return right away
                return true;
            }
            if (shouldRenderResponse(context, currentPhaseId, true))
            {
                skipFurtherProcessing = true;
            }

            if (executor.execute(context))
            {
                return true;
            }
        }
       
        catch (Throwable e)
        {
            // JSF 2.0: publish the executor's exception (if any).
           
            publishException (e, currentPhaseId, context);
        }
       
        finally
        {
            phaseListenerMgr.informPhaseListenersAfter(currentPhaseId);
           
            flash.doPostPhaseActions(context);
           
        }
       
        context.getExceptionHandler().handle();
       
View Full Code Here

Examples of javax.faces.context.Flash

            {
                log.finest("entering " + renderExecutor.getPhase() + " in " + LifecycleImpl.class.getName());
            }
   
            PhaseListenerManager phaseListenerMgr = new PhaseListenerManager(this, facesContext, getPhaseListeners());
            Flash flash = facesContext.getExternalContext().getFlash();
           
            try
            {
                facesContext.setCurrentPhaseId(renderExecutor.getPhase());
               
                flash.doPrePhaseActions(facesContext);
               
                // let the PhaseExecutor do some pre-phase actions
                renderExecutor.doPrePhaseActions(facesContext);
               
                phaseListenerMgr.informPhaseListenersBefore(renderExecutor.getPhase());
                // also possible that one of the listeners completed the response
                if (isResponseComplete(facesContext, renderExecutor.getPhase(), true))
                {
                    return;
                }
               
                renderExecutor.execute(facesContext);
            }
           
            catch (Throwable e)
            {
                // JSF 2.0: publish the executor's exception (if any).
               
                publishException (e, renderExecutor.getPhase(), facesContext);
            }
           
            finally
            {
                phaseListenerMgr.informPhaseListenersAfter(renderExecutor.getPhase());
                flash.doPostPhaseActions(facesContext);
               
                // publish a field in the application map to indicate
                // that the first request has been processed
                requestProcessed(facesContext);
            }
View Full Code Here

Examples of javax.faces.context.Flash

     */
    public static Flash getCurrentInstance(ExternalContext context)
    {
        Map<String, Object> applicationMap = context.getApplicationMap();
       
        Flash flash = (Flash) applicationMap.get(FLASH_INSTANCE);
        if (flash == null)
        {
            // synchronize the ApplicationMap to ensure that only
            // once instance of FlashImpl is created and stored in it.
            synchronized (applicationMap)
View Full Code Here

Examples of javax.faces.context.Flash

            catch (InstantiationException ex)
            {
                throw new UnsupportedOperationException("Cannot get executors from LifecycleImpl", ex);
            }
           
            Flash flash = facesContext.getExternalContext().getFlash();
           
            try
            {
                facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);
               
                flash.doPrePhaseActions(facesContext);
               
                // let the PhaseExecutor do some pre-phase actions
               
                //renderExecutor.doPrePhaseActions(facesContext);
                Method doPrePhaseActionsMethod = phaseExecutor.getClass().getMethod(
View Full Code Here

Examples of javax.faces.context.Flash

            catch (InstantiationException ex)
            {
                throw new UnsupportedOperationException("Cannot get executors from LifecycleImpl", ex);
            }
           
            Flash flash = facesContext.getExternalContext().getFlash();
           
            flash.doPostPhaseActions(facesContext);
           
            facesContext.getExceptionHandler().handle();

            facesContext.getAttributes().remove(PHASE_MANAGER_INSTANCE);
           
View Full Code Here

Examples of net.paoding.rose.web.var.Flash

    public Flash getFlash(boolean create) {
        if (this.flash != null) {
            return this.flash;
        }
        Flash flash = (Flash) getRequest().getAttribute("$$paoding-rose.flash");
        if (flash == null && create) {
            flash = new FlashImpl(this);
            getRequest().setAttribute("$$paoding-rose.flash", flash);
        }
        return this.flash = flash;
View Full Code Here

Examples of org.beangle.struts2.convention.Flash

  private static final long serialVersionUID = 8451445989084058881L;

  @Override
  public String intercept(ActionInvocation invocation) throws Exception {
    String result = invocation.invoke();
    Flash flash = (Flash) invocation.getInvocationContext().getSession().get("flash");
    if (null != flash) flash.nextToNow();
    return result;
  }
View Full Code Here

Examples of org.beangle.struts2.convention.Flash

  protected void addFlashErrorNow(String msgKey, Object... args) {
    getFlash().addErrorNow(getTextInternal(msgKey, args));
  }

  protected Flash getFlash() {
    Flash flash = (Flash) ActionContext.getContext().getSession().get("flash");
    if (null == flash) {
      flash = new Flash();
      ActionContext.getContext().getSession().put("flash", flash);
    }
    return flash;
  }
View Full Code Here

Examples of org.beangle.struts2.convention.Flash

  /**
   * 将flash中的消息转移到actionmessage<br>
   * 不要将flash和message混合使用。
   */
  public Collection<String> getActionMessages() {
    Flash flash = getFlash();
    @SuppressWarnings("unchecked")
    List<String> messages = (List<String>) flash.get(Flash.MESSAGES);
    if (null != messages) {
      for (String msg : messages) {
        addActionMessage(msg);
      }
      messages.clear();
View Full Code Here

Examples of org.beangle.struts2.convention.Flash

  /**
   * 将flash中的错误转移到actionerror<br>
   * 不要将flash和error混合使用。
   */
  public Collection<String> getActionErrors() {
    Flash flash = getFlash();
    @SuppressWarnings("unchecked")
    List<String> errors = (List<String>) flash.get(Flash.ERRORS);
    if (null != errors) {
      for (String msg : errors) {
        addActionError(msg);
      }
      errors.clear();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.