Grails: Redirect to index.gsp that is not in any c

2020-06-08 06:36发布

In Grails, how do I redirect to my home page (index.gsp) which is not part of any controller?

标签: grails
3条回答
淡お忘
2楼-- · 2020-06-08 07:07

If you are redirecting from IndexController, then you should render(view:'/index')

查看更多
够拽才男人
3楼-- · 2020-06-08 07:24

Why do you need a redirect instead of a render? redirect(uri:'/index.gsp') might do the trick but I think I would just render(view:'/index')

查看更多
仙女界的扛把子
4楼-- · 2020-06-08 07:28

You can do a redirect to '/' like this:

redirect(uri:'/')
查看更多
登录 后发表回答