spring-guides / getting-started-guides

Getting Started Guide template :: The template for new guides and also the place to request them.
https://github.com/spring-guides/getting-started-guides/wiki
Apache License 2.0
518 stars 204 forks source link

Guide Uploading Files #149

Closed salityusd closed 1 year ago

salityusd commented 1 year ago

Hello, I have a question about regular expressions. FileUploadController class, serveFile method, @GetMapping("/files/{filename:.+}") annotation. What is the colon used for?

salityusd commented 1 year ago

Spring Expression Language - colon " : " Regular Expression Language - dot and plus ".+" The part after the : specifies a default value. If "filename" is not defined, ".+" will be used as default value. filename.mp3 .mp3 .m