vipx / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Guice servlet style uri mapping is not compatible with servlet API mappings on suffix wildcard patterns, like in /xxxx/* #442

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

In one project we migrated from Pico to Guice, we noticed that Guice does
not match a  url like '/xxxx', if you give  '/xxxx/*'  as url pattern to a
filter in a servlet module, whereas Servlet Api mapping does. 

The reason is, In ServletStyleUriPatternMatcher '*' character is cut off 
from the end of url pattern and then it is checked if the given servlet
path starts with it. To be more specific it checks if  '/xxxx' starts with
'/xxxx/' , which is false. I confirmed it by debugging Guice.

Cihan Uluisik
cihan.uluisik@gmail.com

Original issue reported on code.google.com by cihan.ul...@gmail.com on 29 Oct 2009 at 2:30

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 29 Oct 2009 at 4:11

GoogleCodeExporter commented 9 years ago

Original comment by sberlin on 22 Feb 2011 at 1:42

GoogleCodeExporter commented 9 years ago
Do you really need this distinction?

Original comment by dha...@gmail.com on 22 Feb 2011 at 4:00

GoogleCodeExporter commented 9 years ago
Isn't Guice violating servlet specification here?
See servlet spec 2.5 SRV.11.2.2 Example Mapping Set and tables SRV.11-1 and 
SRV.11-2. You can see that path pattern /baz/* is mapped to servlet2 and 
incoming path /baz is handle by servlet2.
Guice doesn't work that way.

Original comment by tuomohan...@gmail.com on 18 Mar 2011 at 10:22