Cannot Create Iterator For This Collection Error
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error of iterator in mys JSP up vote 1 down vote favorite
TITLLE |
---|
[...] |
[...] |
question is common, but I´m still struggling with the iteratetag.Please can somebody help me?When I´m using the logic:iterate tag I get only the following error:"javax.servlet.ServletException: Cannot create iterator for this collection"The not working code is:
Speaker BureauLog inRegisterSearchSearchCancelError: You don't have JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on https://community.oracle.com/thread/1742448 and reload this page. Please enter a title. You can https://mail-archives.apache.org/mod_mbox/struts-user/200402.mbox/%3C6.0.1.1.0.20040204021946.01e19ac0@mail.michaelmcgrady.com%3E not post a blank message. Please type your message and try again. More discussions in JavaServer Faces All PlacesJavaJava EE (Java Enterprise Edition)JavaServer Faces This discussion is archived 1 Reply Latest reply on Jun 19, 2004 3:12 PM by 843842 Cannot cannot create create iterator for this collection...ArrayList() 843842 Jun 19, 2004 2:41 PM Help please! Process flow ============ Index.jsp is supposed to execute the getCustomer() method in customerAction class. The customerAction is supposed to put a customers ArrayList object in the request scope. the customer.jsp screen is supposed to iterate through the customer cannot create iterator ArrayList object that was placed in the request scope and display the data in their respective fields. My objective is to display the data brought back from the database. When I debugged CustomerAction class with these lines of code: Iterator i = customers.iterator(); while( i.hasNext() ){ System.out.println( "((CustomerBean)i.next()).getFirstName(): " + ((CustomerBean)i.next()).getFirstName() ); } , I got the following out from the Arraylist object that is placed the the request scope: ((CustomerBean)i.next()).getFirstName(): OLA ((CustomerBean)i.next()).getFirstName(): OLATEST ((CustomerBean)i.next()).getFirstName(): SAUD Please tell me the cause of the error and how to work round it. In any case, is there a more efficient way of achieving my objective? Thanks. Ola Oke Error ===== When I execute/run index.jsp screen I get the error below: org.apache.jasper.JasperException: Cannot create iterator for this collection at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455) ... JSP FILES: ========== index.jsp (This is the
RE: Logic Iterate - Cannot Create iterator for this collection Date Wed, 04 Feb 2004 10:20:27 GMT Looks like the object you are trying to iterate over is not a collection. At 02:10 AM 2/4/2004, you wrote: >RUN/servers/bnonline/bnonline.war >04/02 18:05:58 info [axis] getConnection() >04/02 18:05:58 info [axis] Check for timeout, activeCount=1, useCount=1 >04/02 18:05:58 info [axis] Found available connection >04/02 18:05:58 info [axis] Return allocated connection, activeCount=1, >useCou >nt=2 >04/02 18:05:58 user FileServlet: destroy >04/02 18:05:58 info 1 session(s) persisted >04/02 18:05:58 info Removing web application service from servlet engine >service >: bnonline.war >04/02 18:05:59 info Deploying web application >"file:/C:/Tools/JRUN/servers/bnonl >ine/bnonline.war" from: file:/C:/Tools/JRUN/servers/bnonline/bnonline.war >04/02 18:05:59 user JSPServlet: init >04/02 18:05:59 user action: init >04/02 18:05:59 info [axis] Initializing, >config='org.apache.struts.util.LocalStr >ings', returnNull=true04/02 18:05:59 error [axis] Parse Error at line 215 >column > -1: Element "action" does not allow text. >org.xml.sax.SAXParseExcept >04/02 18:05:59 info [axis] Initializing, >config='org.apache.struts.action.Action >Resources', returnNull=true >ion: Element "action" does not allow text. > at org.apache.crimson.parser.Parser2.error(Parser2.java:3317) > at > org.apache.crimson.parser.ValidatingParser$ChildrenValidator.text(Val >idatingParser.java:355) > at > org.apache.crimson.parser.InputEntity.parsedContent(InputEntity.java: >597) > at org.apache.crimson.parser.Parser2.content(Parser2.java:1973) > at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654) > at org.apache.crimson.parser.Parser2.content(Parser2.java:1926) > at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654) > at org.apache.crimson.parser.Parser2.content(Parser2.java:1926) > at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1654) > at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:634) > at org.apache.crimson.parser.Parser2.parse(Parser2.java:333) > at > org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448) > > at org.apache.commons.digester.Digester.parse(Digester.java:1548) > at > org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionSe >rvlet.java:1006) > at > org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet >.java:955) > at > org.apache.struts.action.ActionServlet.init(ActionServlet.java:470) > at javax.servlet.GenericServlet.init(GenericServlet.java:258) > at > jrun.servlet.WebApplicationService.