user09
user09

Reputation: 956

What is String:.+ in spring request mapping's path param

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.

Upvotes: 2

Views: 1000

Answers (1)

alfcope
alfcope

Reputation: 2427

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/[email protected] 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.

Upvotes: 3

Related Questions