jersey
  1. jersey
  2. JERSEY-1648

Support returning Resource model from sub resource locators

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-m12
    • Fix Version/s: 2.0-m12, 2.0
    • Component/s: containers
    • Labels:
      None

      Description

      Sub resource locator could return model resources (org.glassfish.jersey.server.model.Resource).
      Example:

      @Path("root")
      public static class MyResource {

      @Path("locator")
      public Resource subResourceLocator()

      { final Resource resource = getResource(); return resource; }

      private Resource getResource() {
      // any method returning resource ...
      final Resource.Builder builder = Resource.builder();
      builder.addMethod("GET").produces(MediaType.TEXT_PLAIN_TYPE).handledBy(
      new Inflector<ContainerRequestContext, String>() {
      @Override
      public String apply(ContainerRequestContext containerRequestContext)

      { return "get"; }

      });
      return builder.build();
      }
      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Miroslav Fuksa
            Reporter:
            Miroslav Fuksa
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 3 hours Original Estimate - 3 hours
              3h
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 4 hours
              4h