logo       

Issue with request getParameterMap() and it's values passed into a seperate: msg#00191

lang.groovy.user

Subject: Issue with request getParameterMap() and it's values passed into a seperate method

help!! been at the keyboard to long it's all going blurred so excuse
me if i'm missing the obvious but I can't figure the following :

the following script is called from a java servlety and is responsable
for processing posts among other things :

class postThingy implements poster{

..

handlePost(req){
data = req..getParameterMap()
keys = data.keySet()
keys.each{println "${data[it].join(" ")}," }
println new Date()
}
..

}

This prints all the form input elements in a comma delimited format, no probs

but when it is written this way :

class postThingy implements poster{

..

handlePost(req){
data = req..getParameterMap()
keys = data.keySet()
csvIt(data,keys)
println new Date()
..

}

csvIt(data,keys){
keys.each{println "${data[it].join(" ")}," }
}
..

}

The ouput is weird and for some reason the values have been replaced
by oject ids or whatever in the form of :
[Ljava.lang.String;@xxxxxxx

if i just print out the Map (data) in csvIt i get the following:

{d=[Ljava.lang.String;@ce796, dd=[Ljava.lang.String;@1384ed5,
sid=[Ljava.lang.String;@1a631c2, aa=[Ljava.lang.String;@1bf8cd5,
c=[Ljava.lang.String;@b70648, b=[Ljava.lang.String;@1fd9cd5,
id=[Ljava.lang.String;@143724e, did=[Ljava.lang.String;@1057305,
submit=[Ljava.lang.String;@c26c8f, surname=[Ljava.lang.String;@65394b,
ab=[Ljava.lang.String;@19481b2, a=[Ljava.lang.String;@cee271,
bc=[Ljava.lang.String;@749436, f=[Ljava.lang.String;@1ae939f,
firstname=[Ljava.lang.String;@5db9eb,
event=[Ljava.lang.String;@15925c0, e=[Ljava.lang.String;@1bd9d76}

Whats happened to the values, they are visible in the handle method
but not the csvIt method
Any ideas whats going on, it's been a long coding day so it is
probably something really basic ..



--
regards
babelex

#OpenSource means free to innovate#



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise