In a PhaseListener, at which PhaseId should I check for a session timeout?

In a PhaseListener, at which PhaseId should I check for a session timeout?

Right now, I check after RENDER_RESPONSE.

In Netbeans 5.0, I can debug the PhaseListener and it reaches RENDER_RESPONSE and then steps into the logic to check for a session.

I set my session timeout at one minute.

After I wait over a minute, I click on a button on the page, nothing happens, I am not redirected nor is there any information in the server.log for Sun Java System Application Server 8.2.

Thoughts or any suggestions are greatly appreciated.

Thanks,

--Todd

I have the following settings:

web.xml

<session-config>

<session-timeout>1</session-timeout>

</session-config>

faces-config.xml

<navigation-rule>

<navigation-case>

<from-outcome>sessionExpired</from-outcome>

<to-view-id>/index.jsp</to-view-id>

</navigation-case>

</navigation-rule>

<lifecycle>

<phase-listener>com.TimeoutListener</phase-listener>

</lifecycle>

Class

import javax.faces.context.FacesContext;

import javax.faces.event.PhaseEvent;

import javax.faces.event.PhaseId;

import javax.faces.event.PhaseListener;

import javax.servlet.http.HttpSession;

publicclass TimeoutListenerimplements PhaseListener{

public PhaseId getPhaseId(){

return PhaseId.ANY_PHASE;

}

publicvoid beforePhase(PhaseEvent e){

if(e.getPhaseId()== PhaseId.RENDER_RESPONSE){

FacesContext facesContext = e.getFacesContext();

HttpSession sessionx = (HttpSession)facesContext

.getExternalContext().getSession(false);

if (sessionx.getId() ==""){

facesContext.getApplication().getNavigationHandler()

.handleNavigation(facesContext,"","sessionExpired" );

}

}

}

publicvoid afterPhase(PhaseEvent e){

//System.out.println("AFTER " + e.getPhaseId() + " begins");

}

}

[3083 byte] By [jtp512a] at [2007-10-3 2:25:41]
# 1
I'd suggest checking in the RESTORE_VIEW.
rlubkea at 2007-7-14 19:24:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Wait a minute...

Is a PhaseEvent fired after the session ends?

I added logging to my PhaseListener and nothing is added to the server.log after my session timeout.

With a valid session, I have a valid entry for each of the six phases.

Would someone please clarify this.

Thanks,

--Todd

jtp512a at 2007-7-14 19:24:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...