So, you've included the Struts bean tag library along with logic, yes?
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
You can get some weird and misleading error messages if you omit a
taglibs you're using.
The inner class shouldn't cause a problem, since the iterate tag is
designed for that (an attribute or property of an attribute).
For more troubleshooting, did you try setting the inner class as a
standalone page attribute, to see if that works too?
*********** REPLY SEPARATOR ***********
On 1/4/2001 at 9:17 AM Chris Wilson wrote:
hello,
sorry to post this similar message again, but i'm really stumped...
i've run into a problem however trying to use the iterate tag with a
TreeMap
and the write tag... here's a snippet of my code:
<logic:iterate name="subjects" id="subjectEntry" scope="request"
type="java.util.Map.Entry">
// subjects is a TreeMap in the request object... no problem there
// it's my understanding that when the iterate tag is used with a map,
the
// iterator is on the Set of Map.Entries returned by Map.entitySet(),
// therefore the object exposed as subjectEntry should be a
java.util.Map.Entry
<bean:write name="subjectEntry" property="value" scope="page" />
// this is where i get an IllegalAccessException attempting to access
the
//property value of subjectEntry, even though there is a getValue()
method
in the
//api...
</logic:iterate>
just for fun, i replaced the write tag above with the following
scriptlet
which i believe is logically equivalent:
<%=
((java.util.Map.Entry)pageContext.getAttribute("subjectEntry)).getValue(
)
%>
and that works! of course, i could simply use this scriptlet and my
problem
would be solved, but i'd like to use only taglibs if possible and it
seems
to me that the <bean:write> tag should do the same thing...
will <bean:write> only work on "bean-like" objects that are public? in
this
case the object implementing the Map.Entry interface is an inner class
in
TreeMap. is that causing the problem?
what am i missing? thanks for any help!
cheerio,
chris
| chris wilson || web dev ||| [EMAIL PROTECTED] || |
www.wondergeek.com |
|