Grails - map /file.xml to a controller and action -
how map uri suffix controller + action on grails?
i have tried:
name sitemap: "/data.xml" { controller = 'data' action = 'generate' }
but don't work. while this:
name sitemap: "/data" { controller = 'data' action = 'generate' }
works fine...
any ideas?
what have shown there valid. see app @ https://github.com/jeffbrown/urlfilemappingdemo. contains following:
// grails-app/conf/urlmappings.groovy class urlmappings { static mappings = { name sitemap: "/data.xml" { controller = 'data' action = 'generate' } "/"(view:"/index") "500"(view:'/error') } }
the default index page includes link verifies mapping works.
Comments
Post a Comment