• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet compatible to JDK 1.5  RSS feed

 
Ketan Mohite
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am working on a web application, which is supposed to be migrated from Java Version 1.3 to 5.0.

I compiled all the Java classes with 5.0 compiler, but it fails to compile a class which uses Enumeration as it is not included in JDK 5.0.

I have the following piece of code. What modifications I need to make to make it worked in Java 5.0
// request is of type HTTPRequest
Enumeration en = request.getParameterNames();
while (en.hasMoreElements()) {
String key = (String) en.nextElement();
//....
}

Please share your opinions.

Thanks & regards,
Ketan
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ketan Mohite:

... which uses Enumeration as it is not included in JDK 5.0.


Enumeration most certainly is included with JDK 5.0
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Enumeration.html

Are you sure that's the section of code that's causing the problem?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that you didnt use the word enum in the code ? enums are supported in java 5 and cant be used as variable names.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!