Hi I want to find out whether a variable is an array or not
if (params.writtenLines == ???)
much appreicated.
Hi I want to find out whether a variable is an array or not
if (params.writtenLines == ???)
much appreicated.
This functionality is already available in pure Java and can therefore be used in Groovy, too:
if (params.writtenLines.class.isArray())
More importantly, why do you want to check whether it's an array? If you know the parameter might be a single string or a list, you can now use:
def lines = params.list("writtenLines")
That came with Grails 1.2.