users@websocket-spec.java.net

[jsr356-users] [jsr356-experts] overlapping websocket URI mappings

From: Bill Wigger <wigger_at_us.ibm.com>
Date: Tue, 12 May 2015 09:04:36 -0400

I want to clarify a point about Websocket Endpoint mappings and the
Websocket spec.

Case I:
I have a websocket endpoint that is defined
as /mydirectory/myendpoint.html
and I also have a file defined in my WAR at /mydirectory/myendpoint.html

Case II:
Wildcards. I have a websocket endpoint defined
as /mydirectory/{any-string}, and I also have a serlvet mapped
to /mydirectory/myServlet

Possible outcomes of these two cases:

1. Not a valid configuration that may result in errors for one or both of
the mapptings, depending on the websocket implementation.
or
2. the appserver/websocket code should send the request to the websocket
code if and only if the upgrade header value is "websocket",
else it will process the URI without going to the websocket code, using any
applicable URI-without-websocket-upgrade-mapping.
So, logically, there are two exclusive mappings: "URIs with websocket
upgrade headers", and "URIs without websocket upgrade headers"

Answer 1 seems like the right answer, in that you normally don't have
identical URIs map to two different resources.

This would be similar to the servlet question posted here:
https://java.net/jira/browse/SERVLET_SPEC-132?jql=project%20%3D%20SERVLET_SPEC

regards,
Bill Wigger.