google / guice

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google.
https://github.com/google/guice
Apache License 2.0
12.48k stars 1.67k forks source link

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

Open gissuebot opened 10 years ago

gissuebot commented 10 years ago

From cihan.uluisik on October 29, 2009 10:30:05

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: http://code.google.com/p/google-guice/issues/detail?id=442

gissuebot commented 10 years ago

From limpbizkit on October 29, 2009 09:11:02

(No comment was entered for this change.)

Owner: dhanji

gissuebot commented 10 years ago

From sberlin on February 21, 2011 17:42:51

(No comment was entered for this change.)

Labels: Extension-Servlet

gissuebot commented 10 years ago

From dhanji on February 21, 2011 20:00:29

Do you really need this distinction?

gissuebot commented 10 years ago

From tuomohanninen7 on March 18, 2011 03:22:35

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.