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

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

    XMLWordPrintable

Details

    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";

      {{    }}}

      }

       

      Attachments

        Issue Links

          Activity

            People

              rsigal@redhat.com Ronald Sigal
              andymc12 Andy McCright (Inactive)
              Andy McCright Andy McCright (Inactive)
              Andy McCright (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: