Hi i made a ajax request to my controller already. Can my controller send back data as normal eg.
[p:project]
I want to reload google map markers
Hi i made a ajax request to my controller already. Can my controller send back data as normal eg.
[p:project]
I want to reload google map markers
假设您想将项目 obj 作为结果发送回视图 "projectView" ,您可以在控制器中执行类似的操作
render(view : "projectView", model:[p:project]);
然后在您的视图中“使用”结果,如下所示(其中 p 是您从控制器发送的变量的名称
<html><head>Test</head><body>${p}</body></html>
你会想要在 ajax 控制器方法中返回一些东西。假设您有一个名为“_project.gsp”的 gsp 模板,它可能看起来像这样......
def project = Project.get(params.id);
render(template:"project" model:['p':project]);