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

Use servlet mapping from web.xml when not specified in @ApplicationPath

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.5.5.Final
    • Fix Version/s: 4.6.0.Final
    • Component/s: jaxrs
    • Labels:
      None

      Description

      In many cases, it is ideal to define a servlet for an Application subclass in the web.xml. Often this can be done to provide servlet mappings without needing the `@ApplicationPath` annotation.  In most of my cases, we use it so that we can provide additional "value-add" to the application - like adding RolesAllowed security checking, SSL, etc. By using the servlet definitions in the web.xml, it should be possible to create one app that is not secured and another that is.

       

      Additionally, I often will "blend" the resource class and Application subclass into a single class for quick test cases/examples, etc. for example:

      @ApplicationPath("/app")

      @Path("/path")

      public class MyAppAndResource extends Application {

          @GET

          public String get() {

              return "foo";

      {{    }}}

      }

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                andymc12 Andy McCright
                Tester:
                Andy McCright
                Involved:
                Andy McCright
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: