If you study Aaron's examples (somewhat cadged here), you use the iterate tag
with the property set to the arraylist or vector that contains the bean/objects.

 <nested:iterate property="applicationList" id="app" indexId="applIdx">
  <table cellpadding=1 cellspacing=0 border=0 width="100%"><tr><td bgcolor="<%=
_monkeyPerimiter%>">
   <table cellpadding=4 cellspacing=2 border=0 width=100% bgcolor="<%=
_monkeyBorder%>">
       <td bgcolor="<%= _monkeyCell%>" width="5%">
         <font class="monkeyTitle">
         Application ID: <nested:write property="applicationID" /></font>
       </td>
       <td bgcolor="<%= _monkeyCell%>" width="20%">
         Application Name: <nested:text property="applicationName" />
       </td>
       <td bgcolor="<%= _monkeyCell%>" width=30%">
         Application Description: <nested:text property="applicationDesc" />
       </td>
   </tr>
.......

Hope this helps....






Darren McGuinness <[EMAIL PROTECTED]> on 08/21/2002 09:50:34
AM

Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]>;
      Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:    (bcc: Joseph Sadove/DKBDS USA/DKB)

Subject:  Nesting beans


I  have seen in documentation that Struts 1.1 supports nesting tags.
However, I'm using struts 1.0(unavoidable), and  I'm looking to
implement nesting in the beans, and can't find any concrete examples.

I have a LoginForm  bean, and within this bean have an attribute
"session" of type SessionBean (another bean i've made). I've seen an
example(http://www.keyboardmonkey.com/next/Primer_partTwo.jsp?content=yesplease)

showing the way you access in a JSP is:

   <html:text name="logonBean" property="session.requestId"/>
to access the 'requestId' attribute in the SessionBean.

my question now is, if this actually works, how can you have an
attribute which is a vector/list of SessionBeans;
do I just declare an attribute like so:
   vector session;
and have add/remove/get/set methods for it?

then do i access each SessionBean like so:
   <html:text name="logonBean" property="session[0].requestId"/>
?

cheers




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








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

Reply via email to