Since the specification doesn't make an exception for this case, I would say that this is an inconsistency in the implementation. I recommend creating an issue report in Mojarra.

-Dan

On Sun, Sep 6, 2009 at 12:00 PM, Lincoln Baxter, III <lincolnbaxter@gmail.com> wrote:
If the current response has already been completed before RESTORE_VIEW phase (eg, because a PhaseListener called facesContext.responseComplete()  beforePhase ), Faces continues to attempt lifecycle processing. I'm thinking that this should be handled by halting lifecycle processing as defined in the API -- Is this a bug or a something we need to discuss? What do you guys think?


    /**
     * <p>Signal the JavaServer Faces implementation that the HTTP response
     * for this request has already been generated (such as an HTTP redirect),
     * and that the request processing lifecycle should be terminated as soon
     * as the current phase is completed.</p>
     *
     * @throws IllegalStateException if this method is called after
     *  this instance has been released
     */
    public abstract void responseComplete();


Caused by: java.lang.IllegalStateException
at com.sun.faces.context.FacesContextImpl.assertNotReleased(FacesContextImpl.java:639)
at com.sun.faces.context.FacesContextImpl.getCurrentPhaseId(FacesContextImpl.java:515)
at javax.faces.event.ExceptionQueuedEventContext.<init>(ExceptionQueuedEventContext.java:148)
at javax.faces.event.ExceptionQueuedEventContext.<init>(ExceptionQueuedEventContext.java:101)
at com.sun.faces.lifecycle.Phase.queueException(Phase.java:152)
at com.sun.faces.lifecycle.Phase.queueException(Phase.java:145)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:105)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
--
Lincoln Baxter, III
Co-Founder of OcpSoft
Author of PrettyFaces URL Rewriting for JSF





--
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://in.relation.to/Bloggers/Dan