File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes problem using generics jdk1.5 in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem using generics jdk1.5 in jsp" Watch "problem using generics jdk1.5 in jsp" New topic

problem using generics jdk1.5 in jsp

Krisp Sigh

Joined: May 11, 2006
Posts: 9
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

Joined: Dec 11, 2004
Posts: 13410

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.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Consider Paul's rocket mass heater.
subject: problem using generics jdk1.5 in jsp
It's not a secret anymore!