|
I have been trying to track session using listener class in Jrun 4.0
I have added the following class as listener class in the web.xml file for the application.
On session destroy i have to delete few entries from the database...
Sometimes it seems to work but it is creating problems during session creation..
Is there any other way to handle or track sessions.
package bill.sess;
import javax.servlet.*;
import javax.servlet.http.*; import java.util.Date; import jrunx.kernel.JRun; import sess.del.*; public class JRunHttpSessionListener implements HttpSessionListener { public void sessionCreated(HttpSessionEvent se) { } public void sessionDestroyed(HttpSessionEvent se) { JRun.getLogger().logInfo("session destroyed."); try { HttpSession sess= se.getSession(); if(sess.getAttribute("regn")!=null) { JRun.getLogger().logInfo("regn"+sess.getAttribute("regn").toString()); String user_id = sess.getAttribute("user_id").toString(); DelRegInsert del = new DelRegInsert(); del.delRegnInserts(user_id); } } catch(Exception ex) { JRun.getLogger().logInfo("Error in session destroy :"+ex.toString()); } } } the tags added in web.xml is as follows.
|
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com
