Search code examples
grailsgrails-2.0url-mapping

Grails 2.3.8 check url mappings for string occurence


I am trying to map the following

//localhost:8080/user/login/&debug=1

...

//localhost:8080/user/&debug=1

If there is any occurrence of string '&debug=1' then execute some-controller's action.


Solution

  • You could use a URLMapping like this

    "/**&debug=1"(controller:"defaultDebug"){
        action = [GET: "show"]
    }
    

    By using the double wildcard you can catch anything that ends with &debug=1