As others indicated, it's a matter of using the Struts/JSTL tags.

  <ul>
    <logic:iterate id="aFoo" name="resultObjects">
      <li><bean:write name="aFoo" property="propertyName"/></li>
    </logic:iterate>
  </ul>

The biggest difference between Struts1 and what what is posted
below for Struts2 is how you pass the data to the JSP in my 
opinion.

In Struts1, you would still do as you had in your original
post:

  request.setAttribute("resultObjects", resultList);

But instead of using the <% ... %> JSP tags, you would much rather
using the JSTL, Bean, Logic, Html tag libraries accordingly.  They
will keep your JSP pages clean and much easier to read.

HTH,
Chris

> -----Original Message-----
> From: Anjib [mailto:anji...@hotmail.com]
> Sent: Thursday, September 09, 2010 6:27 PM
> To: Struts Users Mailing List
> Subject: Managing code between Action Class and JSP.
> 
> 
>   Yes I am using Struts1.
> 
> On 9/9/2010 5:10 PM, Greg Lindholm wrote:
> >>
> >> <ul>
> >>   <s:iterator value="%{resultObjects}" var="aFoo">
> >>     <li><s:property value="%{#aFoo.propertyName}" /></li>
> >>   </s:iterator>
> >> </ul>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to