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

后端 未结 3 1788
谎友^
谎友^ 2021-02-13 01:03

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

相关标签:
3条回答
  • 2021-02-13 01:50

    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')

    0 讨论(0)
  • 2021-02-13 01:52

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

    0 讨论(0)
  • 2021-02-13 01:58

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

    redirect(uri:'/')
    
    0 讨论(0)
提交回复
热议问题