This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
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 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:
, 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?
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) ...
index.jsp (This is the JSP the processing that leads to the error): =================================================================== <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> <jsp:forward page="/customer.do?methodToExecute=getCustomer"/>