I have a controller function like this
public static void renderCustomersList() {
System.out.println("renderArgs"+renderArgs.toString());
render(renderArgs);
}
In my groovy template
renderArgs ${renderArgs.toString()}
I have renderArgs with value printed in my console but when i pass to the template its printing as null. I wanted those values in my main.html. I printed renderArgs in Both my renderCustomersList.html and main.html the values were null on both templates. What could be the error.
You do not need to pass
renderArgsas a parameter to therenderfunction – all the variables in therenderArgsscope will be available in the template anyway. But instead of accessing therenderArgsobject itself in the template, go for the independent values instead – see below.Controller:
And in the template: