Hi Folks,

I'm using Tomcat 4.01 with Jbuilder 6.  I've got a strange problem.  It
seems that if I try to dump data from a Java bean using the
<jsp:getProperty> tag I don't get the data.  However, if I reference the
value of the bean directly in a scriptlet it works fine.

Here's a code snippet:  

<%
  ArrayList la = (ArrayList) request.getAttribute("list");
  if ( la != null ) {
    Iterator iter = la.iterator();
    while(iter.hasNext()) {
      emp = (EmployeeBean)iter.next();
%>
<tr><td><%= emp.getFirstName() %></td>
    <td><%= emp.getLastName() %></td>
    <td><%= emp.getTitle() %></td>
</tr>

<tr><td><jsp:getProperty name="emp" property="firstName" /></td>
    <td><jsp:getProperty name="emp" property="lastName" /></td>
    <td><jsp:getProperty name="emp" property="title" /></td>
</tr>
<%
    }
  }
%>

The getters work but the <jsp:getProperty> that immediately follows
doesn't.  The strings are not in the generated HTML.  I've looked at the
generated servlet code and it looks ok.  

The scriptlet's version of one line is:
  out.print( emp.getTitle() );

The getProperties version is:
 
out.print(JspRuntimeLibrary.toString((((test.EmployeeBean)pageContext.fi
ndAttribute("emp")).getTitle())));

One more thing.  I walked through the code with the debugger and the
getter is being called in both instances.  

Any suggestion on where I should look?  Any help would be appreciated.

- Rich

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to