Try using:
<c:forEach items="${servletContext.addressesDB.addresses}" ...>
So it gets addressesDB bean from the servletContext and query for the addresses property (it is, calls getAddresses()). If getAddresses reloads the array, it works.
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPIntro7.html#wp71043 (framed page from http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html).
At 10:43 06/07/2004 +0200, you wrote:
Hi, as a training step, I want to convert the sample application by Paul Wood, http://www.onjava.com/pub/a/onjava/2003/01/08/tomcat4.html
so that JSTL is used in place of the scriptlet code inserted in the JSP of this webapp.
I have changed "ContextListener.java" to call AddressesDB.getAddresses which creates the "addresses" ArrayList from Home.jsp; now I do not know how to insert this into the proper pageContext, so that it is available to the "forEach" tag within Home.jsp.
Probably the scope has to be pageContext, because every time the Home.jsp is presented, the list of addresses may have been altered. For the same reason, an updated "addresses" ArrayList will have to be created within Home.jsp.
I do not understand how to accomplish this.
Mit freundlichen Grüßen
Wolfgang Rinnert HBM O-A, SAP Basis tel +49(6151)803-722 mob. +49(160)97843733 fax +49(6151)803-9722 Im Tiefen See 45, D-64293 Darmstadt wolfgang.rinnert-at-hbm.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]