cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Mata <manuel_mata_ru...@yahoo.es>
Subject HttpSessionListener help
Date Fri, 12 Jan 2007 18:08:55 GMT
Hi all. I have an HttpSessionListener and a
ServletContextListener implemented. The second one
works fine when i startup Cocoon, so i get
"Initialized ..." and "Destroyed ..." at the command
window, but the first one Listener does not work when
i enter the application "http://localhost:8888/" or
"http://localhost:8888/viajesallawra/" so i get
nothing at the command window. I have the <listener>
element at web.xml just under the JavaServer Faces
configuration loader. The classes are at
%COCOON_HOME%\build\webapp\WEB-INF\classes\org\mmata\viajesallawra\j2ee
folder. I'm tired of looking but i dont know why it
doesnt work. Here is their code, so someone can help.

Thx anyway.



ServletContextListener
______________________

package org.mmata.viajesallawra.j2ee;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class InicializadorServletContext
implements ServletContextListener {

  public void contextInitialized(
    ServletContextEvent event) {

      ServletContext servletContext = 
        event.getServletContext();
      servletContext.log("Initialized ...");
  }

  public void contextDestroyed(
    ServletContextEvent event) {

      ServletContext servletContext = 
        event.getServletContext();
      servletContext.log("Destroyed ...");
  }
}



HttpSessionListener
______________________

package org.mmata.viajesallawra.j2ee;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class InicializadorHttpSession
implements HttpSessionListener {

  public void sessionCreated(
    HttpSessionEvent event) {
      HttpSession httpSession =
        event.getSession();
      ServletContext servletContext = 
        httpSession.getServletContext();

      servletContext.log("Session Created ...");
  }

  public void sessionDestroyed(
    HttpSessionEvent event) {
      HttpSession httpSession = 
        event.getSession();
      ServletContext servletContext = 
        httpSession.getServletContext();
      servletContext.log("Session Destroyed ...");
  }
}



web.xml
_______

<listener>
<listener-class>org.mmata.viajesallawra.j2ee.InicializadorServletContext</listener-class>
</listener>

<listener>
<listener-class>org.mmata.viajesallawra.j2ee.InicializadorHttpSession</listener-class>
</listener>



		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message