• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem using generics jdk1.5 in jsp

 
Krisp Sigh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this part is in servlet
myData is List<String> myData = get the data from java file
then in the servlet i call the code to show the jsp file which has the following code to recieve the data from servlet

this part is in jsp
List<String> myData = request.getAttribute("myData");
Iterator<String> it = myData.iterator();

but jsp page is now shown
gives this error
Type mismatch: cannot convert from Object to List

am using jdk 1.5
and tomcat 5.5
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat 5.5 ships with and uses it's own compiler (JDT from the Eclipse group). This compiler is not fully 1.5 compliant yet so, even if you're using a Java 1.5 JDK/JRE, JSPs compiled by Tomcat won't understand all of the 1.5 features.

Yet another reason not to put scriptlets in JSPs.
You can write all the Java 1.5 stuff you like in your servlets, beans, and other Java objects with the current version of Tomcat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic