Reputation: 7278
I'm looking at some Spring code that uses a RequestMapping like so:
@RequestMapping("/foo/{bar:.+}")
Is this functionally any different than the following?
@RequestMapping("/foo/{bar}")
From what I can tell the RegExp is always applied to the segment between slashes, so the two should be equivalent (although maybe .+ might say "non-empty?).
I suppose another way to phrase the question might be:
Is Spring's {bar}
equivalent to {bar:.*}
or {bar:.+}
?
Upvotes: 3
Views: 289
Reputation: 49925
Verified using a small test - it is @RequestMapping("/foo/{bar:.+}")
the reason is if it is .*
, it means that /foo/
and /foo/something
will map to the same request mapped method, which it will not.
Upvotes: 2