your code is almost completely wrong you cant use an iterator in this way
after controlling whether list has more elements or not at the while loop, you must first get the first element with it.next(); method and then you can print the content just like that in short: <%=it.next();%>
Once you've acertained that your container is JDK 1.5 aware, you'll need to check your syntax carefully. As tebrik pointed out, it has lots of issues. Since the "<" character is so prevalent, it's hard to tell exactly what it's complaining about. This is just one of the many reasons not to embed Java scriptlets in your JSP pages and to factor Java code out into beans or servlet controllers.
You could make this page a lot more compact and pleasant to read and debug (leave out the directive attributes with suitable default settings and use scriptless pages where possible):In a production application, you'd probably want to take the list creation code and put it in a servlet. So overall you'd only have:Much better!
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )