RE: logic iterate with nested class (I think that's the term)

2003-03-06 Thread Steve Vanspall
Ignore this one,

It seems that Struts doesn't know to go into the Hashtable entry and just
get the value,

Very strange, but basically it was looking to cast the whole entry rather
than just the value.

Will have to convert it to use a list instead

STeve

-Original Message-
From: Steve Vanspall [mailto:[EMAIL PROTECTED]
Sent: Friday, 7 March 2003 10:08 AM
To: Struts User Mailing List
Subject: logic iterate with nested class (I think that's the term)


Hi there,

this  is my problem,

I hap a Map, namely a hashtable, that I want struts to iterate through,

Now the bean class of each entry in the map is
com.crm.util.TemplateBeans.IMGTemplateBean

where TemplateBeans is a class itself.

using the following tag

logic:iterate name=RenderHTMLForm id=imfFile
type=com.crm.util.TemplateBeans.IMGTemplateBean property=imageFields

causes a ClassCastException, even though, I have checked and the object
class matches.

I then tried

logic:iterate name=RenderHTMLForm id=imfFile
type=com.crm.util.TemplateBeans$IMGTemplateBean property=imageFields

this didn't work, I got a error stating that It was expecting a value of
class

com.crm.util.TemplateBeans.IMGTemplateBean but got one of type
java.lang.Object

If I can, I would like to keep these classes nested under
com.crm.util.TemplateBeans, just of eas of use and neatness. Is there a way
to properly reference these classes in the iterate tag??

Thaks in advance

Steve



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



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



Re: logic iterate with nested class (I think that's the term)

2003-03-06 Thread Rick Reumann
On Fri, 7 Mar 2003 10:31:08 +1100
Steve Vanspall [EMAIL PROTECTED] wrote:

 Ignore this one,
 
 It seems that Struts doesn't know to go into the Hashtable entry and
 just get the value,

You can iterate through a map and display the keys and values just fine:

logic:iterate id=element name=someMapInScope
bean:write name=element property=key/ - 
bean:write name=element property=value/BR
/logic:iterate

Or better yet use JSTL tags:

c:forEach var=element items=${someMapInScope}
c:out value=${element.key}/ - 
c:out value=${element.value}/br
/c:forEach

 
-- 
Rick Reumann

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



RE: logic iterate with nested class (I think that's the term)

2003-03-06 Thread Steve Vanspall
Yeah, I am trying to make input tags out of them

Thanks anywa

Steve

-Original Message-
From: Rick Reumann [mailto:[EMAIL PROTECTED]
Sent: Friday, 7 March 2003 10:54 AM
To: Struts Users Mailing List
Subject: Re: logic iterate with nested class (I think that's the term)


On Fri, 7 Mar 2003 10:31:08 +1100
Steve Vanspall [EMAIL PROTECTED] wrote:

 Ignore this one,
 
 It seems that Struts doesn't know to go into the Hashtable entry and
 just get the value,

You can iterate through a map and display the keys and values just fine:

logic:iterate id=element name=someMapInScope
bean:write name=element property=key/ - 
bean:write name=element property=value/BR
/logic:iterate

Or better yet use JSTL tags:

c:forEach var=element items=${someMapInScope}
c:out value=${element.key}/ - 
c:out value=${element.value}/br
/c:forEach

 
-- 
Rick Reumann

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



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