Jetty
  1. Jetty
  2. JETTY-129

ServletContextListeners called after servlets are initialized

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.1, 6.1.0
    • Fix Version/s: 6.0.2, 6.1.0pre0
    • Component/s: Servlet
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      This problem was raised by Caleb Land on the jetty-support mailing list.

      I've modified the embedded example he provided to make this one that demonstrates the problem:
      import javax.servlet.*;
      import javax.servlet.http.*;
      import org.mortbay.jetty.*;
      import org.mortbay.jetty.servlet.*;

      public class test3 {

      public static class mylistener implements ServletContextListener
      {
      public void contextInitialized(ServletContextEvent sce)

      { System.err.println("contextInitialized "+sce); }

      public void contextDestroyed(ServletContextEvent sce)

      { System.err.println("contextDestroyed "+sce); }

      }

      public static class myservlet extends HttpServlet
      {
      public void init ()

      { System.err.println("myservlet initialized"); }

      }

      public static void main(String[] args) throws Exception

      { System.setProperty("DEBUG", "true"); Server server = new Server(8080); Context context = new Context(server, "/", Context.SESSIONS); // Add the wicket servlet ServletHolder servletHolder = new ServletHolder(new myservlet()); servletHolder.setInitParameter ("applicationFactoryClassName", "wicket.spring.SpringWebApplicationFactory"); servletHolder.setInitOrder (1); context.addServlet(servletHolder, "/app/*"); // Add the Spring context listener mylistener listener = new mylistener(); context.addEventListener(listener); server.start(); server.join(); }

      }

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Jan Bartel
            Reporter:
            Jan Bartel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: