我制作了index.gsp的副本,称为index_1.gsp,我喜欢从html页面调用。
因为我确实知道如何从html页面调用它,所以我尝试使用以下命令从 Controller 调用index_1.gsp:redirect(uri:“/index_1.gsp”),但是失败了。
如果您能帮助我从html页面或 Controller 中调用它,我将不胜感激。
谢谢
最佳答案
您不能从HTML页面调用GSP。这没有道理。
如果要从 Controller 渲染 View ,可以执行以下操作...
class SomeController {
def someAction() {
// this will render grails-app/views/some/index_1.gsp
render view: 'index_1'
}
}
关于grails - 调用.gsp页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24368795/