How to reference a grails GSP model variable indirectly e.g. via .get(…)
问题 I'm using a GSP for sending out emails based on the MailService plug-in. The sendMail closure passes (amongst others) body(view:..., model:myModel) I know that I can access every item of the myModel Map just using ${itemName} in the GSP. However as I sometimes want to build the item name dynamically like 'item'+i , I need to have some surrounding method to access the variable. I already tried ${model.get('item'+i) , and ${params.get('item'+i) , but model is null and params is an empty Map. I