Hello All,
I am trying to understand an example from Chapter 8 of the WDJSP by
Fields&Kolb that relates to passing a bean from a servlet to a jsp page.
<Code listing below>. The accessor methods work OK, but the getProperty
tags do not. They behave like they are referring to an empty bean. I'm
guessing that there is some sort of scope problem here, but I don't see
it.
The jsp graps a vector beans from the request and then prints the
properties from each one.
Any help would be much appreciated!
-- john
<body>
<b>Current Employees</b>
<ul>
<%
Vector v = (Vector)request.getAttribute("list");
Iterator i= v.iterator();
while (i.hasNext()) {
employee = (EmployeeBean)i.next();
%>
<li>
<a href="/webdev/servlet/FetchEmployeeServlet?cmd=get&id=
<%= employee.getId() %>">
<%= employee.getLastName() %>,
<%= employee.getFirstName() %>
</a>
<jsp:getProperty name="employee" property="id"/>
<jsp:getProperty name="employee" property="lastName"/>,
<jsp:getProperty name="employee" property="firstName"/>
<% } %>
</ul>
</body>
</html>
===============================================================================
John Cartwright
Professional Research Assistant / Associate Scientist
CIRES, SEG/NGDC/NOAA
(303) 497-6284
[EMAIL PROTECTED]
===============================================================================
===========================================================================
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