Download a partial Ajax template - with Grails

I create grails webapp and have a main gsp index, and there are several common components that will be distributed on most pages on the site for which I use partial templates.

Each partial template will be quite isolated and contain very different information, so everyone should receive information from different controllers.

What I want is a page load, for each partial template, to call the controller to load the necessary content. Im hoping there is some kind of tag that I can easily place in my partial templates by specifying a controller / action that will automatically call the controllers on boot.

Is it possible?

---- EDIT -----

In addition, one of the partial template controllers will retrieve information from the web service, which may take some time, so it would be nice if I could also download these templates asynchronously.

Thank!

+5
source share
1 answer

That for the <g: include> tag . This is very useful in itself, but even more so if combined with the springcache plugin and using page fragment caching. Since include invokes regular action in the controller, you can also use it when calling ajax.

+4
source

All Articles