tyrus
  1. tyrus
  2. TYRUS-203

the value associated to @PathParam is not correct

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1
    • Component/s: None
    • Labels:
      None

      Description

      @ServerEndpoint(value="/echo/")
      public class EchoServerEndpoint {
      @OnMessage
      public String echo(String message, @PathParam("color") String color)

      { return color + ":" + message; }

      }

      Suppose we have the following:
      1. Client A: access /echo/black with message "one". Get "black:one".
      2. Client B: access /echo/green with message "two". Get "green:two".
      3. Client A: with previous websocket connection open, send "three". Instead of getting "black:three". We get "green:three".

      From debugger, in org.glassfish.tyrus.core.SessionImpl, the pathParameters is the same in (1) and (3). However the value inside have changed.

      Look like the last access path param wins in this case.

        Activity

        Hide
        Pavel Bucek added a comment -

        firstly, I can see an issue in your code. @ServerEndpoint value should be something like "/echo/", so it is little weird that your endpoint is matched. Anyway, will investigate.

        Show
        Pavel Bucek added a comment - firstly, I can see an issue in your code. @ServerEndpoint value should be something like "/echo/ ", so it is little weird that your endpoint is matched. Anyway, will investigate.
        Hide
        Pavel Bucek added a comment - - edited

        reproduced; fix sent to internal review.

        Show
        Pavel Bucek added a comment - - edited reproduced; fix sent to internal review.
        Hide
        Pavel Bucek added a comment -

        fixed in the trunk (rev 687).

        Show
        Pavel Bucek added a comment - fixed in the trunk (rev 687).
        Hide
        Shing Wai Chan added a comment -

        There is a typo in description.
        It should be
        @ServerEndpoint(value="/echo/")

        Show
        Shing Wai Chan added a comment - There is a typo in description. It should be @ServerEndpoint(value="/echo/ ")

          People

          • Assignee:
            Pavel Bucek
            Reporter:
            Shing Wai Chan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: