【发布时间】:2016-05-31 10:37:15
【问题描述】:
我需要直接从 restfull 资源调用 gsp 页面,现在我通过 URI 使用 groovy 控制器进行调用,但我需要不使用 groovy 控制器直接调用吗?
【问题讨论】:
标签: grails groovy grails-orm
我需要直接从 restfull 资源调用 gsp 页面,现在我通过 URI 使用 groovy 控制器进行调用,但我需要不使用 groovy 控制器直接调用吗?
【问题讨论】:
标签: grails groovy grails-orm
你可以directly map an url to a view。
只需将映射添加到您的UrlMappings.groovy:
class UrlMappings {
static mappings = {
"/"(view: "/index") // map the root URL to index view
"/any/url"(view: "/anyview")
}
}
【讨论】: