You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/03/26 14:46:43 UTC
[Bug 54754] New: WebSocket endpoint servlet mappings shadowed by "/"
mapping
https://issues.apache.org/bugzilla/show_bug.cgi?id=54754
Bug ID: 54754
Summary: WebSocket endpoint servlet mappings shadowed by "/"
mapping
Product: Tomcat 8
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: rstoyanchev@yahoo.com
Classification: Unclassified
Currently WebSocket endpoints are mapped via Servlet mappings, which does not
appear to work if another Servlet is mapped with "/" or "/*". The root servlet
mapping in particular is very commonly preferred over mapping by prefix (e.g.
"/app/*") or by extension ("/*.do") in order to keep URLs meaningful and
without any additional path segments or extension (see for example [1]).
Replacing WsServlet with WsFilter would allow WebSocket endpoints to be mapped
to specific paths without interfering with Servlet mappings.
[1]
http://stackoverflow.com/questions/2129876/using-spring-mapping-to-root-in-web-xml-static-resources-arent-found
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54754] WebSocket endpoint servlet mappings shadowed by "/"
mapping
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54754
--- Comment #2 from rstoyanchev@yahoo.com ---
The easiest way to reproduce is to add "/" Servlet to
tomcat/trunk/webapps/examples/WEB-INF/web.xml after which websocket echo no
longer works.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54754] WebSocket endpoint servlet mappings shadowed by "/"
mapping
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54754
--- Comment #4 from Mark Thomas <ma...@apache.org> ---
Hmm. That behavior isn't what I'd expect. Let me take a look to figure out what
I am missing.
My only reluctance to switch to a filter is that it is more work and I have
enough of that already. That said, if there are scenarios that simply can't be
matched with a Servlet (and I suspect that there are once you start looking at
URI templates of the form /{parma1}/... ) then there may be no choice but to
switch to Filter.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54754] WebSocket endpoint servlet mappings shadowed by "/"
mapping
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54754
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #5 from Mark Thomas <ma...@apache.org> ---
The only reason the examples fail is that by mapping a servlet to / you are
overriding the default servlet that is used to serve the HTML files. If you
change the files to have .jsp extensions (and change the links) you'll be able
to access the pages. Alternatively, you could point a WebSocket client directly
at the appropriate URL.
I'll look into my own concerns regarding mapping and URI templates separately.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54754] WebSocket endpoint servlet mappings shadowed by "/"
mapping
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54754
--- Comment #3 from rstoyanchev@yahoo.com ---
Note that Spring MVC can delegate back to the "default" Servlet container
servlet, if no mapping is found [1]. That said is there any downside to a
WsFilter? Seems less obtrusive and FWIW the RI does that.
[1]
http://static.springsource.org/spring-framework/docs/current/spring-framework-reference/html/mvc.html#mvc-default-servlet-handler
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54754] WebSocket endpoint servlet mappings shadowed by "/"
mapping
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54754
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
What URIs are you mapping your web socket servlets to?
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54754] WebSocket endpoint servlet mappings shadowed by "/"
mapping
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54754
--- Comment #6 from rstoyanchev@yahoo.com ---
OK that makes sense. Thanks!
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org