How do I create a catch-all URL-mapping in Grails?
The following Grails UrlMapping ..
class UrlMappings {
static mappings = {
"/$something"{
controller = "something"
action = "something"
}
}
}
.. appears to match ^/[^/]*
but how do I create an UrlMapping matching all URLs (^/.*
)?
You're looking for the ** "double wildcard". Example:
class UrlMappings {
static mappings = {
"/**"(controller: "something", action: "something")
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With