| | |
JSP iterator error with structs
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
Hello there,
I've got some information which is stored in a class object, these objcts are transfered to an action in the format of a set.
I'm trying to put the set into a bean into my JSP, however im not having much luck.
The error is as follows:
The JSP code:
My action code: which is invoked before forwarding to this page - it should but the bean into scope:
the structs configuration file:
and finally the MMIUtils contains this:
any ideas?
I've got some information which is stored in a class object, these objcts are transfered to an action in the format of a set.
I'm trying to put the set into a bean into my JSP, however im not having much luck.
The error is as follows:
•
•
•
•
org.apache.jasper.JasperException: Cannot create iterator for this collection
JSP Syntax (Toggle Plain Text)
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h1>JSP Page</h1> <jsp:useBean id="address" scope="session" class="Address.AddressForm"> <logic:iterate id="myIterator" name="address" type="Address.AddressDTO"> <bean:write name="myIterator" property="addresses.name"/> </logic:iterate> </jsp:useBean> </body> </html>
My action code: which is invoked before forwarding to this page - it should but the bean into scope:
JSP Syntax (Toggle Plain Text)
import Data.MyFactory; imports......... public class AddressAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //Returns a list of accidents and sets accidents attribute in session AddressDAO myDAO = MyFactory.getFactory("standard").getDAO(AddressDAO.class); request.setAttribute(MMIUtils.addresses,myDAO.retrieveAll()); return mapping.findForward("success"); } }
JSP Syntax (Toggle Plain Text)
<action path="/AddressAction" type="Address.AddressAction"> <forward name="success" path="/success.jsp"/> </action> </action-mappings>
JSP Syntax (Toggle Plain Text)
static public String addresses = "addresses";
any ideas?
![]() |
Similar Threads
- what is wrong with this jsp expression? (JSP)
- Help in JSP Doubt (JSP)
- About <error-page> tag in struts (JSP)
- URGENT: JSP - StackOverFlow Error (JSP)
- tomcat jsp problem (JSP)
- [urgent] JSP problem (JSP)
Other Threads in the JSP Forum
- Previous Thread: Uploading file on server side
- Next Thread: JSP's not getting compiled
| Thread Tools | Search this Thread |
Tag cloud for JSP
apache array backbutton combobox comma connection csv database development directorystructure dropdownlist dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 mysql netbeans network parameters passing ping printinserverinsteadofclient project read redirect request.getparameter response seperated servlet servletdopost()readxml sessions software sql ssl state_saving_method stocks sun tomcat tutorial update values video web write





