Grails多视图实现

时间:2014-08-12 08:26:39

标签: grails user-interface views

所以我试图结合我所拥有的4个grails应用程序的单独视图。

所以,我开始结合两个,我为不同的数据集创建了两个域类,分别为两个控制器。现在,我有2" index.gsp"我必须基本上结合起来。

我正在考虑使用一个基本的超链接,其中一个可以转到" index.gsp"(第1部分),另一个转到" index.gsp" (第2部分)

但是,我无法找到访问多个视图的URL。

我尝试使用以下内容:how can i render to the gsp view of other controller?

在index.gsp中:

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

在ComController中:

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

在PgtypController中:

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

但是,点击&#34;重定向到finalView.gsp&#34;后,我收到错误:

HTTP Status 404 - /composite2/comController/redirect

type Status report

message /composite2/comController/redirect

description The requested resource is not available.

另外,在我的视图文件夹中 - 我有&#34; index.gsp&#34;和&#34; pagetype.gsp&#34;。 当我的应用程序运行时,我可以查看index.gsp - localhost:8080 / composite2

如何访问&#34; pagetype.gsp&#34;?

欢迎所有方法/建议访问此处的多个观点

0 个答案:

没有答案