-
1. Re: Not getting Session TimeOut event
sunkaram Feb 23, 2012 11:20 AM (in response to erez135)Please provide error details..
Are you getting the problem once you add session listener?
-
2. Re: Not getting Session TimeOut event
erez135 Feb 23, 2012 11:28 AM (in response to sunkaram)Maheswara,
Thanks for your fast replay .
i add this to the web.xml:
<listener>
<listener-class>user.MySessionListener</listener-class>
</listener>
my problem is that by try to run my tomcat server it gives me this error
type Status report
message /jsfQa/faces/index.xhtml
description The requested resource (/jsfQa/faces/index.xhtml) is not available.
by remove the added listener tag from the web.xml the problem not appear
-
3. Re: Not getting Session TimeOut event
sunkaram Feb 23, 2012 11:48 AM (in response to erez135)Are you refering to /jsfQa/faces/index.xhtml in your code?
can you post your session listener code ?
where are you forcing session timeout in 10sec?
not seeing session timeout config in web.xml..
-
4. Re: Not getting Session TimeOut event
erez135 Feb 26, 2012 1:31 AM (in response to sunkaram)my sessionTimeOut code
package usr;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
public class MySessionListener implements HttpSessionListener {
public MySessionListener(HttpSessionEvent event) {
System.out.println("session");
}
@Override
public void sessionCreated(HttpSessionEvent arg0) {
System.out.println("session created");
}
@Override
public void sessionDestroyed(HttpSessionEvent arg0) {
System.out.println("session ends");
}
}
i force ( give maximux session time out value) session timeout using two option's
1. using code :
public void logout(){
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) fc.getExternalContext().getRequest();
request.getSession().setMaxInactiveInterval(10);
this.sessionid= request.getSession().getId();
}
2. set it in my web.xml
<session-config>
<session-timeout>2</session-timeout>
</session-config>
both option create sesstion timeOut ( i confirm it by getting the session id ).
but i am unable to get any event for session time out.
Thanks for your help