Here ya go (except I used LabelValueBean, its virtually the same as your
'A'):
<[EMAIL PROTECTED] contentType="text/html;charset=UTF-8" language="java" %>
<[EMAIL PROTECTED] import="org.apache.struts.util.LabelValueBean"%>
<[EMAIL PROTECTED] import="org.apache.struts.taglib.html.Constants"%>
<[EMAIL PROTECTED] import="java.util.Hashtable"%>
<[EMAIL PROTECTED] import="java.util.ArrayList"%>
<[EMAIL PROTECTED] import="testing.SimpleBeanForTesting"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html>
<head>
<title>My Test Page</title>
<html:base/>
</head>
<body bgcolor="white">
<%
Hashtable artists=new Hashtable();
ArrayList titles=new ArrayList();
String cast="Pahwa";
titles.add(new LabelValueBean("shashi","bhushan"));
titles.add(new LabelValueBean("vijay","kumar"));
artists.put(cast,titles);
cast="Dua";
titles=new ArrayList();
titles.add(new LabelValueBean("sunil","kumar"));
artists.put(cast,titles);
pageContext.setAttribute("artists",artists);
%>
<logic:iterate id="artist" name="artists" indexId="index">
Artist: <li><bean:write name="artist" property="key"/></li>
<logic:iterate id="title" name="artist" property="value">
<bean:define id="a" name="title"/>
<li><bean:write name="a" property="label" /></li>
<bean:write name="a" property="value" />
</logic:iterate>
</logic:iterate>
</body>
</html:html>
--
James Mitchell
Web Developer/Struts Evangelist
http://www.apache.org/struts/
> -----Original Message-----
> From: shashi_struts [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 10:17 AM
> To: Struts Users Mailing List
> Subject: Re: logic:iterate examples plz.
>
>
> hi Gamor
> Thanks for reply.
>
> This code not solve my problem
> i am sending my code .plz help me
> Hashtable artists=new Hashtable();
> ArrayList titles=new ArrayList();
> String cast="Pahwa";
> titles.add(new A("shashi","bhushan"));
> titles.add(new A("vijay","kumar"));
> artists.put(cast,titles);
> cast="Dua";
> titles=new ArrayList();
> titles.add(new A("sunil","kumar"));
> artists.put(cast,titles);
> pageContext.setAttribute("artists",artists);
> and
> i has been used this one for show the records
>
> <logic:iterate id="hash" name="artists" indexId="index" >
> Artist: <li><bean:write name="hash" property="key" /></li>
> <logic:iterate id="array" name="hash" property="value" >
> <bean:define id="a" name="array"/>
> <li><bean:write name="a" property="name" /></li>
> <bean:write name="a" property="value" />
> </logic:iterate>
> </logic:iterate>
>
> plz. help me
>
>
> ----- Original Message -----
> From: "Gemes Tibor" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 27, 2003 7:26 PM
> Subject: Re: logic:iterate examples plz.
>
>
> > shashi_struts wrote:
> >
> > >HI
> > >I am working on the concept in which i stored string as
> key and arraylist
> as value in the hashtable.The arraylist stores a class name A
> which have two
> parameter name and value
> > >
> > >
> > >I tried too much but not succeed to print the value in
> key,value in
> wirte manner.
> > >
> > >
> > >
> >
> > http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate
> >
> > |<logic:iterate id="entry" name="myMap">
> > <bean:write name="entry" property="key"/>
> > <logic:iterate id="subelement" name="entry" property="value">
> > <bean:write name="subelement"/>
> > || </logic:iterate>
> > ||</logic:iterate>
> >
> > Hth,
> >
> > Tib
> > |
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > 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]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]