Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-11068

Wrong error: This parameter type (javax.servlet.http.HttpServletRequest) cannot be annotated with @Context

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.3.0.Beta1
    • 3.3.0.Beta1
    • webservices
    • None

      Upon checking in the channel with maxandersen, he found that the following code is related:

      • Validates that the method parameters annotated with {@link Context}

        are of the supported types in the spec:

      • {@link UriInfo}

        ,

        {@link HttpHeaders}

        ,

        {@link ServletConfig}

        ,

        {@link ServletContext}

        ,

        {@link HttpServletRequest}

        ,

      • {@link Request}

        ,

        {@link HttpServletResponse}

        and

        {@link Response}

        ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/metamodel/domain/JaxrsResourceMethod.java

      According to the above javadoc, @Context is legal with HttpServletRequest.
      However, the plugin produces an error on the following line of code (for example):
      public Response get(@Context HttpServletRequest requestContext, @PathParam(EntitiesRestConsts.PARAM_ID) ObjectId id) {

            xcoulon@redhat.com Xavier Coulon
            webron_jira Ron Ratovsky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: