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

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -