This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Groovy and the fly likes HowTo --> GroovyShell().evaluate( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "HowTo --> GroovyShell().evaluate("[ Watch "HowTo --> GroovyShell().evaluate("[ New topic

HowTo --> GroovyShell().evaluate("['item1', 'item2', 'item3']")

John Dee

Joined: May 13, 2010
Posts: 3

Would someone happen to know how to take a List or Map defined as a String (i.e. read off an InputStream) and assign the contents of that string to a List/Map object.

Something like GroovyShell().evaluate("[name:'nameVale', phone:'phoneVal', zip:'zipVal']"), but this does not work. I get the following error message:

No signature of method: com....GroovyShell() is applicable for argument types: () values: []

Craig Treptow

Joined: Oct 29, 2007
Posts: 16
This looks helpful:

Stack Overflow - Best Way To Code This
It is sorta covered in the JavaRanch Style Guide.
subject: HowTo --> GroovyShell().evaluate("['item1', 'item2', 'item3']")
Similar Threads
(finished)Question related to s:select
GroovyShell wait?
Map within a List
Doubt in EL [] operator