I am trying to read input in scalatra webapp using for iteration in below manner
for (
input1<- params.getOrElse("input1", "");
input2 <- params.getOrElse("input2", "");
search <- params.getOrElse("search", false)
) {
//Perform action
}
It is throwing error value foreach is not a member of Object.
In case if user doesn't provide any input, it should default empty string and call the action instead of breaking out of loop. For that reason i am using getOrElse. But i haven't succeeded.
Any help?