user1180463
user1180463

Reputation: 245

Grails params map as java.util.HashMap

In my grails project, can I use params map (object of GrailsParameterMap) as java.util.HashMap on application level ?

I want to do this for using Serializability of java.util.HashMap. I can use params as java.util.HashMap everywhere in the code. But how can i achieve this on application level ?

I am using grails 1.3.7

Thanks in advance.

Upvotes: 1

Views: 4016

Answers (1)

Tiago Farias
Tiago Farias

Reputation: 3407

Well, following @Gregg suggestion, of pulling the data out of the params map into an object, you can do it like this:

Map paramsMap = new HashMap()

params.each {key, value ->
  paramsMap.put(key, value)
}

And save this HashMap in the session. I hope it helps.

Upvotes: 2

Related Questions