grizzly
  1. grizzly
  2. GRIZZLY-1404

Servlet Mapping Issue when integrating Jersey and Spring

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.19
    • Fix Version/s: 2.2.20, 2.3, 3.0
    • Component/s: http, http-servlet
    • Labels:
      None

      Description

      Can follow this link
      http://grizzly.1045725.n5.nabble.com/Integration-Grizzly2-2-X-with-Jersey-and-Spring-td5710024.html

      I am trying to integrate Grizzly v2.2.19 with Jersey and Spring
      Below is my code

      HttpServer server = new HttpServer();
      NetworkListener listener = new NetworkListener("grizzly2", "localhost",3388);
      WebappContext ctx = new WebappContext("ctx","/");
      final ServletRegistration reg = ctx.addServlet("spring", new SpringServlet());
      reg.addMapping("/*");
      ctx.addContextInitParameter("contextConfigLocation","classpath:spring-context.xml");
      ctx.addListener("org.springframework.web.context.ContextLoaderListener");
      ctx.addListener("org.springframework.web.context.request.RequestContextListener");
      ctx.deploy(server);
      server.start();

      The code could be compiled and executed with no exception. However all urls which should be forwarded to different methods by Jersey are
      now all forwarded to the default page "/".

      Thanks to Oleksiy.
      There is a workaround as below
      Change
      WebappContext ctx = new WebappContext("ctx","/");
      to
      WebappContext ctx = new WebappContext("ctx","");

      I file this issue as it is still not an expected behavior.

        Activity

        Hide
        oleksiys added a comment -

        fixed

        [2.2.x]
        Revision: 8e17fef89bd289a629d4cfc36195de3556e41213
        Date: 2013-01-15 16:00:51 UTC

        [2.3.x]
        Revision: 029e5a591d65a81ca808d111994a1d4b335cce80
        Date: 2013-01-15 15:59:54 UTC

        [master]
        Revision: b98e11ceeb7cac4888024b6df045367a6f6ca73d
        Date: 2013-01-15 15:59:54 UTC

        Log Message:
        ------------
        + fix issue #1404
        http://java.net/jira/browse/GRIZZLY-1404
        "Servlet Mapping Issue when integrating Jersey and Spring"

        Show
        oleksiys added a comment - fixed [2.2.x] Revision: 8e17fef89bd289a629d4cfc36195de3556e41213 Date: 2013-01-15 16:00:51 UTC [2.3.x] Revision: 029e5a591d65a81ca808d111994a1d4b335cce80 Date: 2013-01-15 15:59:54 UTC [master] Revision: b98e11ceeb7cac4888024b6df045367a6f6ca73d Date: 2013-01-15 15:59:54 UTC Log Message: ------------ + fix issue #1404 http://java.net/jira/browse/GRIZZLY-1404 "Servlet Mapping Issue when integrating Jersey and Spring"

          People

          • Assignee:
            oleksiys
            Reporter:
            nennenpow
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: