Trying to create REST-ful URLs with multiple dots in the “filename” part – Spring 3.0 MVC

The @PathVariable pattern matching is a bit twitchy when it comes to dots in the URL (see SPR-5778). You can make it less twitchy (but more picky), and get better control over dot-heavy URLs, by setting the useDefaultSuffixPattern property on DefaultAnnotationHandlerMapping to false.

If you haven’t already explicitly declared a DefaultAnnotationHandlerMapping in your context (and most people don’t since it’s declared implicitly for you), then you can add it explicitly, and set that property.

Leave a Comment