hades
hades

Reputation: 4696

Spring boot Request Mapping URI Patterns

There is a request mapping like this:

@DeleteMapping(value = "/{version:.+}")

I not sure what is the .+ does, but from what i know, this delete mapping can accept a value and match to path variable version, something like:

DELETE
/abc

Value abc will map to path variable version

Why the .+ is needed?


Edited Question: What is the difference with just /{version}, is there any special case that requires .+?

Upvotes: 0

Views: 412

Answers (2)

iamrajshah
iamrajshah

Reputation: 979

You can find details or URL matching on this link
URL matching

REGEX: .+ means one or more.
‘*’ Matches 0 or More Characters
'+' Matches 1 or More.

Upvotes: 4

Antoniossss
Antoniossss

Reputation: 32507

@DeleteMapping(value = "/{version:.+}")

.+ means "one or more of any characters" - thats standard regex/

version: means - put that match in path variable named version.

Upvotes: 2

Related Questions