Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a Grails catch-all URL-mapping

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 (^/.*)?

like image 699
knorv Avatar asked Oct 29 '09 23:10

knorv


Video Answer


1 Answers

You're looking for the ** "double wildcard". Example:

   class UrlMappings {
      static mappings = {
        "/**"(controller: "something", action: "something")
      }
    }
like image 150
ataylor Avatar answered Oct 24 '22 11:10

ataylor