Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1519

Add SpringContextLoaderListener(WebApplicationContext context) constructor

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 3.1.0.CR1, 3.0.20.Final
    • None
    • None
    • None

      [from https://github.com/resteasy/Resteasy/pull/956 ]

      This allows for code such as

      Server server = new Server(8080);
      ServletContextHandler contextHandler = new  ServletContextHandler(ServletContextHandler.SESSIONS);
      AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
      rootContext.register(AppConfig.class);
      contextHandler.addEventListener(new ResteasyBootstrap());
      contextHandler.addEventListener(new SpringContextLoaderListener(rootContext));
      contextHandler.addServlet(HttpServletDispatcher.class, "/*");
      server.setHandler(contextHandler);
      server.start();
      server.join();
      

      to be used inside of a servlet 3.0 container such as the Jetty server, without requiring web.xml and applicationContext.xml files.

            rhn-support-asoldano Alessio Soldano
            rhn-support-asoldano Alessio Soldano
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: