Susha Naidu
Susha Naidu

Reputation: 307

What does ":.+" in `{param:.+}` means (java)?

What does the :.+ at {param:.+} mean in this set of code in java? I have tried searching however i do not find any explanation. Someone who knows please do explain it to me. Thank you so much.

BatchFileController.java

@RequestMapping("/runbatchfileparam/{param:.+}")  
public ResultFormat runbatchFile(@PathVariable("param") String fileName) 
{  
RunBatchFile rbf = new RunBatchFile();  
return rbf.runBatch(fileName);  
}  

Upvotes: 5

Views: 256

Answers (2)

pvpkiran
pvpkiran

Reputation: 27048

This is used if in case your path variable has . in them. For example, if you want to pass a inner field in mongo as a path variable to fetch from database. (student.address.id). By default everathing after the first dot is ignored. To tell spring framework not to truncate :.+ is used.

Upvotes: 1

Kraylog
Kraylog

Reputation: 7553

The colon : is separator between the variable name and a regular expression.

The expression .+ means at least one of any character.

Upvotes: 10

Related Questions