Given this UrlMapping:
'/foo/$foobar' { controller = 'foo' action = 'foo' constraints { } }
Combined with this controller:
class FooController { def foo = { def foobar = params.foobar println 'foobar=' + foobar } }
And with these requests:
- http://localhost:8080/app/foo/example.com give the output ‘foobar=example’
- http://localhost:8080/app/foo/examplecom give the output ‘foobar=examplecom’
It seems like Grails cuts the ‘foobar’ parameter at the first dot (‘.’). Is this intentional? Is there a work-around if I want to use parameters containing dots in my URL mappings?
This can be solved by setting …
… in Config.groovy.
It seems like Grails is trying to do some MIME magic behind the scene based on the file name suffix.
Updated: Some additional info from the Grails JIRA.
This is the offending code in UrlMappingsFilter.java:
WebUtils.areFileExtensionsEnabled() returns the value of the ‘grails.mime.file.extensions’ setting configured in Config.groovy.