Friday, June 28, 2013

Re: Session Listener

If you're still looking to hook into your web application's start/stop lifecycle, you can use a ServletContextListener to do so.

On Wednesday, June 26, 2013 10:44:15 AM UTC-5, Magallo wrote:
Ok, it works! Thanks!

My mistake was to think that the sessionCreated event was created when the application started. Shame on me! The sessionCreated  is called instead the first time the application interacts with the server. Another wrong assumption by me was that I thought the sessionDestroyed was called when the user closes the web page or navigate to another web site. Wrong! The sessionDestroyed is called after some time of non interaction between the client and the server, no matter if the web page is still open or has been closed. Another time shame on me! I just decided to describe that here to share my discovery.


On Friday, June 21, 2013 11:35:58 PM UTC+2, Valavanur Man wrote:
We resolved the issue by added session listener to web.xml under Web-inf, as described above. We created the build.xml from GWT and referred to the web.xml.
<target name="war" depends="javac, gwtc, libs">
<delete file="${}" />
      <war basedir="war" destfile="${}" webxml="war/WEB-INF/web.xml"  />
      <jar destfile="${}" basedir="war" duplicate="preserve" />
<!-- clean up -->
<delete dir="@dot" />

We use ant to build the war file outside eclipse to build the project.

Hope this helps.


On Friday, June 21, 2013 12:40:21 AM UTC-7, Magallo wrote:
Hi Valavanur, I know your question is a little outdated, but I have the same necessity and I don't knbow how to do. I mean, I tried in my GWT Explise project, to add a Session Listener as explained by loladi but it seems it doesn't work. Obviously I alse added the <listerner> section in my web.xml file, but it seems my listener is just ignored and does not execute the code. I tried adding some brerakpoints in the sessionCreated and sessionDestroyed methods, but simply the execution never stops at these points. What am I missing?


On Monday, June 2, 2008 1:16:11 AM UTC+2, Valavanur Man wrote:
I would like to implement Session Listener to log the logins and
logouts. Would like to do some housekeeping upon logout.

How do I register the class implementing SessionListener in GWT. How
do I modify the WEB.xml so that it works both in Hosted mode and as
well as when I deploy the war file.

Can you provide some instructions/help.


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment