Daniel,

Here is a solution to your problem. This will redirect the client back to your 
login page event when it is a PPR.

In faces-config.xml:

   <lifecycle>

      
<phase-listener>org.nemours.estore.ui.filter.LoginPhaseListener</phase-listener>

    </lifecycle>

In LoginPhaseListener:

public class LoginPhaseListener implements PhaseListener {

    /**
     * @see 
javax.faces.event.PhaseListener#afterPhase(javax.faces.event.PhaseEvent)
     */
    public void afterPhase(PhaseEvent pPhaseEvent) {
        log.debug("afterPhase:" + pPhaseEvent.getPhaseId());
    }

    /**
     * @see 
javax.faces.event.PhaseListener#beforePhase(javax.faces.event.PhaseEvent)
     */
    public void beforePhase(PhaseEvent pPhaseEvent) {
        log.debug("beforePhase:" + pPhaseEvent.getPhaseId());
        if (pPhaseEvent.getPhaseId() == PhaseId.RENDER_RESPONSE) {
            FacesContext facesContext = pPhaseEvent.getFacesContext();
            log.debug("source:" + pPhaseEvent.getSource().toString());

            HttpSession httpSession = (HttpSession) 
facesContext.getExternalContext().getSession(false);
            String requestURI = 
((HttpServletRequest)facesContext.getExternalContext().getRequest()).getRequestURI();
            if ((!requestURI.endsWith("login.jsf")) && 
(requestURI.endsWith(".jsf"))) {
                AppUser user = (AppUser) 
httpSession.getAttribute(LOOKUP_SESSION_USER);
                if ((user == null) || (user.equals(""))) {
                    
facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext,
 "loginAction",
                            "failure");
                }
            }
        }
    }

    /**
     * @see javax.faces.event.PhaseListener#getPhaseId()
     */
    public PhaseId getPhaseId() {
        return PhaseId.ANY_PHASE;
    }
}

-----Original Message-----
From: Daniel Hannum [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 29, 2007 3:19 PM
To: adffaces-user@incubator.apache.org
Subject: ADFFACES-37 (PPR and timeout)


Hi,

 

I'm curious if any more thought has gone into the timeout issue with PPR
(ADFFACES-37). It's still a problem. If the session times out and and
PPR request is (I believe) sent to the login page. But the browser
doesn't display it and the user has no way of knowing. They just get a
page that doesn't update.

 

Are there workarounds?

 

Thanks.

Dan


Reply via email to