Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Grails 中,如何重定向到不属于任何控制器的主页 (index.gsp)?
您可以像这样重定向到“/”:
redirect(uri:'/')
为什么需要重定向而不是渲染?redirect(uri:'/index.gsp')可能会成功,但我想我会render(view:'/index')
redirect(uri:'/index.gsp')
render(view:'/index')
如果你从 IndexController 重定向,那么你应该 render(view:'/index')