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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -