• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on getParameterNames and getParamaterValues return types

 
Lorenz Baylon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know why getParameterNames returns Enumeration type while getParameterValues returns a String array? Is it possible that getParameterNames will return a collection of non-String values? Thanks.
 
Ankit Garg
Sheriff
Posts: 9597
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about it, parameter names comes as a part of HTTP request, which is plain text, then how can getParameterNames return something which is not String...
 
Lorenz Baylon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ankit, given that fact, then why does the getParameterNames return an Enumeration instead an array of Strings?
 
Devaka Cooray
Marshal
Posts: 5209
508
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the javadoc for java.util.Enumeration - You may get the idea.
 
Lorenz Baylon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Devaka. Im not really sure if im getting it, but can't the getParameterValues method also return an Enumeration rather than a String array, with the same reason that the getParamaterValues method returns one?
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!