Try using for comprehensions for (res <- JSONParser.parse(S.params("results").first); (key, value) <- res) yield some_expression
Marius On Jul 15, 11:51 am, fbettag <fr...@bett.ag> wrote: > Args Sorry, the Full(Map(..)) gets returned by the JSON Parser. > > for (res <- JSONParser.parse(S.params("results").first); (key, value) > <- res) { > Log.error(key + " -> " + value) > > } > > Anyhow it still doesn't run through the loop. This stuff is really > over-complicated. > > On Jul 15, 10:20 am, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote: > > > On Wed, Jul 15, 2009 at 10:01 AM, fbettag<fr...@bett.ag> wrote: > > > > Ok, i found out that the POSTed JSON was in S.params("results").first, > > > which contains: > > > > Full(Map(name -> New Content, language -> en, content -> , id -> ext- > > > record-1)) > > > > So i tried this: > > > for ((key, value) <- JSONParser.parse(S.params("results").first)) { > > > Log.error(key + " -> " + value) > > > } > > > > But it doesn't go through the loop. I guess it has something to do > > > with the Full() around the Map. > > > I tried .elements on the returned Full() for an iterable, but it still > > > doesn't run through the loop. > > > > Any ideas? > > > If S.params("results") contain > > Full(Map(name -> New Content, language -> en, content -> , id -> ext- > > > > record-1)) > > > It seems like it's already parsed, in which case you could do > > > for (results <- S.params("results"); (key, value) <-results) { > > Log.error(key + " -> " + value) > > } > > > /Jeppe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---