Question

maybe I am just asking google & co. the wrong questions but this is what I want to accomplish:

I have a GSP template with a nested template within. The outer one has access to the members of a domain class instance. Instead of passing all the domain member like

<g:render template="/image/alternativeTemplate" model="${[member1: member1, member2: member2]}"/>

or using the iterator like

<g:render template="/image/alternativeTemplate" model="${[it: it]}"/>

i would like to do simply use outer GSP's model in the inner one.

Am I missing something?

Greetings, smon

Était-ce utile?

La solution

To expose the entire model to a template for rendering use pageScope.variables such as:

<g:render template="/some/template" model="${pageScope.variables}"/>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top