Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-8124

Servlet-mapping for application using org.springframework.web.servlet.DispatcherServlet requires to add resources into Application subclass

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • REST
    • None
    • Hide
      • Get attached reproducer
      • mvn clean package
      • deploy target/dispatcher-servlet-mapping.war
      • curl -v "http://localhost:8080/dispatcher-servlet-mapping/resources/example
      • To fix servlet mapping uncomment code in org.resteasy.DemoApp class
      Show
      Get attached reproducer mvn clean package deploy target/dispatcher-servlet-mapping.war curl -v "http://localhost:8080/dispatcher-servlet-mapping/resources/example To fix servlet mapping uncomment code in org.resteasy.DemoApp class

      Jaxrs Application which contains org.springframework.web.servlet.DispatcherServlet, needs for correct mapping of the resource add resource classes into Application subclass getClasses() method.

      By jax-rs 2.0 specification "2.3.2 Servlet" the resource classes must be included automatically:
      " When an Application subclass is present in the archive, if both Application.getClasses
      and Application.getSingletons return an empty collection then all root resource classes and
      providers packaged in the web application MUST be included "

      This issue is related to JBEAP-8070, but it differs in one extra step needed (adding resource classes into the Application subclass).

      See attached reproducer.

            rsearls r searls
            kanovotn Katerina Odabasi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: