| Author |
why i can't get the hashtable value printed?
|
Meir Yan
Ranch Hand
Joined: Apr 27, 2006
Posts: 597
|
|
hello all i have simple hashtable i can get the keys but i cant get the values why?
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16479
|
|
|
Copying the request.getParameterMap() into your own Hashtable is just obfuscation, you could work directly with the Map. However your problem is that the values of that Map are string arrays and not strings, so your code will throw a ClassCastException.
|
 |
Meir Yan
Ranch Hand
Joined: Apr 27, 2006
Posts: 597
|
|
Hello and thank for the fast reply , what do you mean by working directlly with the map , and how can i convert the string array to string ?
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16479
|
|
Originally posted by Meir Yan: Hello and thank for the fast reply , what do you mean by working directlly with the map , and how can i convert the string array to string ?
You use a Map exactly in the same way you were using that Hashtable, only without all the obsolete classes. I think you have been reading examples that are several years old.And how can you convert the string array to a string? Well, why would you want to do that? It's a string array for a reason.
|
 |
 |
|
|
subject: why i can't get the hashtable value printed?
|
|
|