Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@apache.org Received: (qmail 75369 invoked from network); 13 Nov 2002 18:21:10 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 13 Nov 2002 18:21:10 -0000 Received: (qmail 20360 invoked by uid 97); 13 Nov 2002 18:21:48 -0000 Delivered-To: qmlist-jakarta-archive-struts-user@jakarta.apache.org Received: (qmail 20308 invoked by uid 97); 13 Nov 2002 18:21:47 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 20283 invoked by uid 98); 13 Nov 2002 18:21:46 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <207a01c28b41$5b959520$ea41c584@gte.com> From: "Jana Navaneethan" To: "Struts Users Mailing List" References: <1fc601c28b35$6aa87e30$ea41c584@gte.com> <008101c28b3c$76ded990$5500a8c0@bhickey> Subject: Re: Problem with using Vector? Date: Wed, 13 Nov 2002 13:20:34 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Brian, Thanks for your help I appreciate it. Actually I have a ViewListingBean which represents the Object in the listingsSummary Vector. In my JSP, I have already defined bean like this When I try to use same id "viewListing" in my iterate tag it complains about the id been already defined? I need to use the "viewListing" bean id for displaying some other properties in my JSP page. Now how do I define my id in iterate tag? which reperesents the same bean. Actual error message is No bean found under attribute key viewListingBean Thanks, Jana. ----- Original Message ----- From: "Brian Hickey" To: "Struts Users Mailing List" Sent: Wednesday, November 13, 2002 12:45 PM Subject: Re: Problem with using Vector? > Jana, > > It would help to see the actual error. > > More below... > > Hi, > > I have a Vector in my form bean which contains multiple Objects, I > > want to loop through the contents of this Vector in my JSP page, I have a > > getListingsSummary() method in my form bean which is viewListingForm, But > > for some reason when I call my JSP it throws some exception like > > No bean found under attribute key viewListingBean > > > > Here is my iterate tag > > > property="listingsSummary"> > > This says you have a bean named "ViewListingForm" that has some scope > (request/session) in your JSP. Also that you will refer to that items in the > property collection in "listingsSummary" by the scripting variable > "ViewListingBean". The property accesses the collection (List/Vector) you > want by calling the form getter for "listingsSummary". > > To be thorough, you will need to include the "type" attribute to identify > the object type that will be found in the collection "listingsSummary". It > looks like type="java.util.Vector". > > > > > Here is my form Bean > > > > public Vector getListingsSummary() > > { > > return(this.listingsSummary); > > } > > > > public void setListingsSummary(Vector listingsSummary) > > { > > this.listingsSummary = listingsSummary; > > } > > > > The getter will be called by the iterate tag for "listingsSummary" and you > have the case correct. > > > > > My Action class sets the form bean before forwarding to the JSP page.. > > > > ViewListingForm listingform = (ViewListingForm) form; > > listingform.setListingsSummary(listingsSummary); > > > > > > BTW what is this id means in the iterate tag? Any help would be greatly > > appreciated! > > Always check the Javadoc (start at: http://jakarta.apache.org/struts/ ). The > "id" attribute names the scripting variable you will use within the iterate > tag. In other words, each object contained in the Vector "listingsSummary" > will be referred to as "ViewListingBean". > > So you can now use ViewListingBean to access the individual properties of > the objects in your listingsSummary. For example name="ViewListingBean" property="someProperty"/> > > > > > Thanks in advance, > > Jana. > > > > > > > > -- > > To unsubscribe, e-mail: > > > For additional commands, e-mail: > > > > > > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > -- To unsubscribe, e-mail: For additional commands, e-mail: