grailsgroovyescapingurlmappings.groovy

How does one escape the # sign in a Url pattern in UrlMappings.groovy?


In order to maintain the current set of Urls in a project, I have to be able to use the # (pound sign) in the Url. For some reason the pound sign does not appear to work normally in this project for UrlMappings.groovy.

Is there a special escape-sequence that must be used when placing # signs in UrlMappings.groovy?

Am I missing some reason why one cannot use pound signs at all?

In the following URL Mapping example, the browser goes to the correct page, but the pageName variable is null:

"/test/${urlName}#/overview"(controller:'test', action:'overview') {
    pageName = "overview"
}

Solution

  • I thought everything after # in the url would be treated on the client side of the browsers where it tries to find a and scroll to that location.

    If you dump the request containing the pound char, do you even see the data behind #?