Skip to content

Instantly share code, notes, and snippets.

@Joxebus
Created November 12, 2018 23:56
Show Gist options
  • Save Joxebus/68e9b844681eba310e2a28715b5f47e1 to your computer and use it in GitHub Desktop.
Save Joxebus/68e9b844681eba310e2a28715b5f47e1 to your computer and use it in GitHub Desktop.
Example controller with parameters in groovy for Spring Boot
// app.groovy
@RestController
class ThisIsAnExample {
@RequestMapping('/{name}')
String sayHello(@RequestParam(value = "name",
required = false) String name){
"Hello ${name ?: 'World'} from Spring Boot + Groovy"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment