gpt4 book ai didi

grails - 调用.gsp页面

转载 作者:行者123 更新时间:2023-12-02 15:28:15 25 4
gpt4 key购买 nike

我制作了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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com