Win a copy of Design for the Mind this week in the Design forum!
  • 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: 9519
22
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
ExamLab Creator
Marshal
Pie
Posts: 4317
233
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic