While I was modifying the code written by other developer I come across an end point @RequestMapping(value = "/ICD/{icdcode:.+}
and wanted to know what is :.+ in the path variable.
Asked
Active
Viewed 857 times
2

user09
- 920
- 2
- 12
- 38
1 Answers
3
This has already been answered
Spring MVC @PathVariable getting truncated
Spring MVC @PathVariable with dot (.) is getting truncated
Spring - Path variable truncate after dot - annotation
Basically, it is a regular expression. Spring considers that anything behind the last dot is an extension and get rid of it.
If you have a mapping to /somepath/{email}
and try /somepath/test@gmail.com
the value for the path parameter email
will be test@gmail
Using the regular expression {pathparam:.+} everything is considered part of the value, even what is behind the last dot.
-
Thanks for clarification. It would have been answered but when I search exactly with the key words I didn't find any matching answers. – user09 Feb 17 '17 at 15:47