• Post Reply Bookmark Topic Watch Topic
  • New Topic

why i can't get the hashtable value printed?  RSS feed

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all
i have simple hashtable i can get the keys but i cant get the values
why?
 
Paul Clapham
Sheriff
Posts: 22509
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 22509
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!