Hi,
I'm trying to pass an Array from a Servlet to JSP. My problem is that all of
the values that show up on the JSP are zero, but I get the correct length of
the size of the Array. (I am using Tomcat 3.1 on NT)

Here's what I have

in the Servlet:
-----------------
AccountBean[] aB = getAccounts();
req.setAttribute("accounts",aB);

in the JSP:
-------------
<jsp:useBean id="acct" class="AccountBean" scope="request"/>
<%
AccountBean acctArray = (AccountBean[]) request.getAttribute("accounts");
%>
Length-<% =acctArray.length%>
<br>
<%
for (int i=0; i < acctArray.length; i++)
{
acct = acctArray[i];
%>
<br>id- <jsp:getProperty name="acct" property="ID"/>
<br>name-<jsp:getProperty name="acct" property="name"/>
<br>percentage- <jsp:getProperty name="acct" property="percent"/>
<% } %>

Result (displayed in browser)(if I have 2 accounts in the array)
---------
Length-2

0

0.0

0

0.0


I also tried using vectors, but I get the same result.

Does anyone have any ideas? I just started working with JSPs and have been
stuck on this for a while now, so I'd really appreciate any help.

Thanks so much,
Enriqueta

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to