I am trying to setup an HttpSessionListener for my GWT application.
I edited the tomcat/conf/gwt/web.xml and added inside the <web-app> </
web-app> the following lines:
<listener>
<listener-class>xft.oli.server.SessionListener</listener-class>
</listener>
Here`s the coding for the xft.oli.server.SessionListener class:
package xft.oli.test.server;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
public class SessionListener implements HttpSessionListener {
public void sessionCreated(HttpSessionEvent arg0) {
// TODO Auto-generated method stub
System.out.println("session created");
}
public void sessionDestroyed(HttpSessionEvent arg0) {
// TODO Auto-generated method stub
System.out.println("session destroyed");
}
}
I am not sure that I am doing this setup correctly.
So here's what I get in the GWT console:
[WARN] StandardContext[]Error configuring application listener of
class xft.oli.server.SessionListener
java.lang.ClassNotFoundException: xft.oli.server.SessionListener
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1340)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1189)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
3775)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:
4343)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
595)
at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:
277)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:
832)
at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:
701)
And then in my browser I get a error 404 message informing that the
page is not available.
Let me know if you ideas how to solve this problem,
Sincerely,
Olivier MATT
I would strongly recommend to use an external server instead of the built in one. (see -noserver posts in the forum for setting it up)
But meanwhile you should change the web.xml under tomcat/webapps/ROOT/WEB-INF and add your listener there. (and not under conf/gwt)
HTH
Dominik
-----Ursprüngliche Nachricht-----
Von: Google-We...@googlegroups.com [mailto:Google-We...@googlegroups.com] Im Auftrag von OlivierMatt
Gesendet: Donnerstag, 5. April 2007 10:40
An: Google Web Toolkit
Betreff: How to setup a HttpSessionListener ?