You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Econopouly <jo...@hotmail.com> on 2000/07/07 16:49:58 UTC

Bug with jsp:getProperty tag?

We've noticed the following strange behavior:
If we use two beans in our jsp, one of which is a list,
and the other of which represents a record in that list
that gets assigned within the jsp, we can't use getProperty
to read a value in the record bean, although we _can_ read it
using the bean's get method directly...

For example, in this code fragment,
1: <jsp:useBean id="entities" class="AdminEntityListBean"/>
2: <jsp:useBean id="entity" class="EntityRecordBean" />
3:
4: <%-- construct the entity list by reading from db --%>
5: <% if(entities.readDB()){ %>
6:     <% entity=entities.getEntityAt(0); %>
7:     <jsp:getProperty name="entity" property="name"/> <br>
8:     <%= entity.getName() %> <br>

line 7 will resolve to an empty string,
line 8 will resolve to the actual entity name.
This appears to happen consistently across similar situations.
The same code works fine using the jswdk.
We're using 3.1/linux6.1/sun jdk1.2.2.

Anyone seen this or know what's going on?
thanks
j

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