When you do it that way your not storing it as an array, you just storing
one element of the array. You probably want to store the Entire bookmark
array in the session variable not just one element in it.

session.setAttribute("myBookmarkArray", MyBookMarkArray);

And to loop through your array try something like this...

<% for(int i=0;i < MyBookMarkArray.length;i++) { %>
        <%= MyBookMarkArray[i].toString()%> <br>
<% } %>


_____________________________________________
Pete Freitag ([EMAIL PROTECTED])
CFDEV.COM
Web Developer Resources
http://www.cfdev.com/
 Check out ActivEdit a WYSIWYG HTML Editor that works like a Textarea
 http://www.cfdev.com/activedit/




-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Peter Dolukhanov
Sent: Monday, May 20, 2002 8:34 PM
To: [EMAIL PROTECTED]
Subject: Re: showing a looping in JSP with arrays


You have to use session.getVariable to initialize the said variable on a
different page. Also, can anyone verify that you can save arrays this
way?

Regards,
Pete Dolukhanov

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]] On Behalf Of Richard Diaz
Sent: 20 May 2002 21:35
To: [EMAIL PROTECTED]
Subject: showing a looping in JSP with arrays

in my JSP page I get a NULL POINTER EXCEPTION...

<%=MyBookmarkArray[1].getpk() %> </br>

I have verified there are 3 bookmarks created in my
servlet they are session variables using:
session.setAttribute("MyBookmarkArray[" + i + "]",
MyBookmarkArray[i]);

also I can see all my non array session variables just
not this array one... a scope problem?

it would be great if someone could point me to an
example of looping through an array and rendering it
in my jsp page.


Also, anyone know of a good JSP Forum? I need to also
figure out how to loop output of the above array
inside the JSP.

thanks in advance.
Rich


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to