Hi, I have a service that contains a map:
static Map cargosMap = ['1':'item1','2':'item 2','3':'item 3']
that is returned via a method in the service:
static Map getCargos() {
[cargosMap]
}
A controller calls it like this:
def mform = {
Map cargos = empService.getCargos()
[cargos:cargos]
}
In the gsp, I have the select:
<g:select name="cg1" from="${cargos}" />
But I'm getting the exception:
Error 500: Executing action ....caused exception:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object
...
with class 'java.util.ArrayList' to class
'java.util.Map'
Any clues ? Thanks