resthub / springmvc-router

Adds route mapping capacity to any "Spring MVC based" webapp. Uses playframework.org Router implementation.
http://resthub.github.com/springmvc-router/
Other
167 stars 63 forks source link

No check for HttpRequestAdapter.path being null #50

Closed DCKcode closed 11 years ago

DCKcode commented 11 years ago

I misconfigured my Spring servlet mapping to / instead of /*. This results in HttpServletRequest.getPathInfo() always yielding null, which eventually leads to a NullPointerException for every request in the routed application. The trouble is, you won't know about your misconfigured application beforehand, because @RequestMapping works just fine without the asterisk!

This could be migitated by degrading more gracefully in case of HttpRequestAdapter.path being null, and maybe giving a warning message suggesting a misconfiguration of the web application. Maybe you could give this a short mention this in the docs as well, as it prevents this from being a drop-in replacement for @RequestMappings in some cases.

(This was in response to your feedback request, I have no other means to contact you outside of GitHub :) )

bclozel commented 11 years ago

I had another issue like that recently. Could you check issue #41 and see how it´s related? I definitely want to get the whole servlet mapping/configuration stuff right for this release.

I'll check this and add more test cases. Thanks!

DCKcode commented 11 years ago

Ah, another issue duplication. That issue exactly describes mine.