I have a Grails GSP page similar to this:
<!DOCTYPE html>
<html lang="en">
<head>
...
<script type="text/javascript">
var currency = ${Currency.getList() as JSON};
</script>
</head>
...
</html>
And a groovy file similar to this:
package enums
import java.util.List;
public final class Currency {
private static final List CURRENCIES = ['PHP','USD','HKD'];
static List getList(){
return CURRENCIES
}
}
Now it shows an error message:
groovy.lang.MissingMethodException
No signature of method: static java.util.Currency.getList() is applicable for argument types: () values: [] Possible solutions: getAt(java.lang.String), getClass(), split(groovy.lang.Closure), notify(), wait()
How can I resolve this? The groovy file is placed in project/src directory, and is not allowed to move (if that helps).