using HttpSessionListener

Hello,

I added a listener to web.xml

<listener>

<listener-class>milagesoft.SessionListener</listener-class>

</listener>

and created a class which implements HttpSessionListener

package milagesoft;

import javax.servlet.http.HttpSessionEvent;

import javax.servlet.http.HttpSessionListener;

publicclass SessionListenerimplements HttpSessionListener{

privateint counter;

publicvoid sessionCreated(HttpSessionEvent httpSessionEvent){

String id = httpSessionEvent.getSession().getId();

counter ++;

}

publicvoid sessionDestroyed(HttpSessionEvent httpSessionEvent){

counter--;

}

publicint getCounter(){

return counter;

}

}

when I debug the application, it doesn't break into sessionCreated method. Should I do some more settings ?

[1597 byte] By [xyzta] at [2007-11-27 9:59:46]
# 1
Are you invoking a request anyway?Besides, I should declare the counter and it's getter static.
BalusCa at 2007-7-13 0:30:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

> Are you invoking a request anyway?

>

> Besides, I should declare the counter and it's getter

> static.

Yes, I invoke the index.jsp but neither the debugger breaks into sessionCreated method nor the counter increases. ( I tried to make the counter and the getter static, nothing chages...)

xyzta at 2007-7-13 0:30:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Making it static of course doesn't fix the problem ;) Have you saved the web.xml and restarted the appserver anyway?
BalusCa at 2007-7-13 0:30:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
yes I restarted the server but nothing changes...It seems strange. I have done what is needed but it still hangs on...
xyzta at 2007-7-13 0:30:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...