jersey
  1. jersey
  2. JERSEY-1565

Path associated with PathParam behaves differently on having slash

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.9
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Environment:

      Windows7

      Description

      Open Empservice.java in the attached application. Focus on @DELETE and @POST. Both have a PathParam associated with them. Observe the @Path annotations on each of these methods.
      @DELETE has @Path("/

      {name}")
      @POST has @Path("{name}

      ")
      Note that the difference is the presence of slash in Path annotation corresponding to @POST.

      The snippet of WADL generated for these two operations is as below:

      <ns0:resource path="/

      {name}">
      <ns0:param name="name" style="template" xmlns:ns2="http://www.w3.org/2001/XMLSchema" type="ns2:string"/>
      <ns0:method id="deleteEmployee" name="DELETE">
      <ns0:response>
      <ns0:representation mediaType="/"/>

      </ns0:response>
      </ns0:method>
      </ns0:resource>
      <ns0:resource path="{name}

      ">
      <ns0:param name="name" style="template" xmlns:ns3="http://www.w3.org/2001/XMLSchema" type="ns3:string"/>
      <ns0:method id="updateEmployee" name="POST">
      <ns0:response>
      <ns0:representation mediaType="application/json"/>
      </ns0:response>
      </ns0:method>
      </ns0:resource>

      Here, as seen,

      {name} and /{name}

      are not treated as the same. However, as per the WADL spec, they are to be treated the same.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Jakub Podlesak
            Reporter:
            padbhat
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: