Grails multiple views implementation

五迷三道 提交于 2019-12-13 02:27:09

问题


so I am trying to combine separate views of 4 grails application that I have.

So, I set about with combining two, I created two domain classes for the separate datasets, two controllers respectively. And now, I have 2 "index.gsp" which I have to combine basically.

I was thinking of having a basic hyperlink, of which one can go to "index.gsp"(Part 1) and the other to "index.gsp" (Part 2)

But, I am unable to find the URL to access multiple views.

I tried the following using : how can i render to the gsp view of other controller?

In index.gsp :

<g:link controller="ComController" action="redirect">Redirect to finalView.gsp </g:link>

In ComController :

def redirect = {
            redirect (controller:"PgtypController", action:"renderView")
            }

In PgtypController :

def renderView = {
    render(view:"pagetype");
    }

But, after clicking on "Redirect to finalView.gsp", I am getting an error :

HTTP Status 404 - /composite2/comController/redirect

type Status report

message /composite2/comController/redirect

description The requested resource is not available.

Also, in my views folder - I have "index.gsp" and "pagetype.gsp". When my app is running, I can view index.gsp - localhost:8080/composite2

How do I access "pagetype.gsp"?

All approaches/suggestions are most welcome to access multiple views here

来源:https://stackoverflow.com/questions/25259483/grails-multiple-views-implementation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!