You don't need <jsp:useBean> as struts tags look into scope themself. (usebean create 
a scriptlet variable from a bean)

Your code looks fine. Look at objB code, getter should not be well formed.
- be carreful about uppercase beginig properties
- be carreful not to have mulitple setters with different data types (IFAIK it will 
break javaBean PropertyInfo)
- be carreful getter is public

Nico.



Hi,
I'm a bit confusing using the jsp struts tag logic:iterate.
Here is my problem.

In my business logic I've created an object (let's call it "objA") that contains a 
Hashtable which itself contain a list
of objects ("objB") . The Hastable object ("hTable") can be accessed through getter 
and setter from "objA".
I want now to display as a table the property "prop" of all "objB" objects contained 
in the Hashtable "hTable" ("prop"
is a String  and can be accessed through getter and setter from "objB".

Before launching the jsp I've put objA in the HTTP request.

Then I've coded the following  in the Jsp :

<jsp:useBean id="objA" class="ObjA" scope="request"></jsp:useBean>

<logic:iterate name="objA" property="hTable" id="objB" indexId="ind" >
    Next element is <bean:write name="objB" property="prop" /> [<bean:write 
name="ind"/>]
</logic:iterate>

Coding this, I get the following error :

[Servlet Error]-[No getter method for property prop of bean objB]:


I tried then to code :

<jsp:useBean id="objA" class="ObjA" scope="request"></jsp:useBean>

<logic:iterate name="objA" property="hTable" id="objB" indexId="ind" type="ObjB" >
    Next element is <bean:write name="objB" property="prop" /> [<bean:write 
name="ind"/>]
</logic:iterate>

In this case I get the following error :

[Servlet Error]-[JSP 1.2 Processor]: java.lang.ClassCastException: 
java.util.Hashtable$Entry

Can anyone tell me what I am doing wrong please ?

Thanks for your help

Jean-Michel Auguste



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to