Grails传递数据以从控制器查看 [英] Grails pass data to view from controller
本文介绍了Grails传递数据以从控制器查看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我已经向我的控制器发出了一个ajax请求。我的控制器可以以正常
的形式发回数据,例如:
Hi i made a ajax request to my controller already. Can my controller send back data as normal eg.
[p:project]
我想重新加载Google地图标记
I want to reload google map markers
推荐答案
你会想用ajax控制器方法重新渲染一些东西。假设你有一个名为_project.gsp的gsp模板,它可能看起来像这样...
You'll want to rending something back in ajax controller method. Assuming you have a gsp template called "_project.gsp" it could look something like this...
def project = Project.get(params.id);
render(template:"project" model:['p':project]);
这篇关于Grails传递数据以从控制器查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文