You could save the set object into the request object as:
request.setAttribute("officer", new BlahBlahOfficer());
and then use strut Logic tag in your view to iterate through the list as:
<logic:Iterate name="officer" id="Item" property="totalExcessSet">
<logic:Iterate name="Item" id="excess">
<bean:write name="excess"
property="excess_property_name_to_print" />
</logic:Iterate>
</logic>
The list that you pass has to implement an Iterator.
I have not ran the snippet of code above but that is the idea.
On Wed, Sep 29, 2010 at 1:02 AM, hareendra seneviratne <[email protected]
> wrote:
> Hi Thank u all for ur replies.
>
> This is my next step...
>
> Here is the source of one of my model classes, Officer
> public class Officer {
> private String id;
> private String error = null;
> private Set<Excess> *totalExcessSet* = new HashSet<Excess>();
> .........
>
> In my execute() method I have an Officer Instance.
> I want to iterate through *totalExcessSet *property of this instance within
> my view. How am I gonna do this??
>
> Many thanks again
>
>
>
>
> On Wed, Sep 29, 2010 at 5:23 AM, serge nana <[email protected]> wrote:
>
> > Hareendra,
> >
> > You don't need to have an ActionForm in order to invoke an Action class.
> An
> > ActionForm is a data transfer object (DTO) that allows you to transfer
> data
> > from the view to the controller( in this case your action). So, if you
> want
> > to use struts and you have a form to send to the server, i recommend you
> to
> > use ActionForm.
> >
> > In the big picture though, an Action class is a Servlet sub-class. Just
> > like
> > you can retrieve variables from the request object inside a doXXXX
> method,
> > so you can do the same inside the *execute()* method by calling
> > request.getParameter("param_name").
> >
> > Hope this helps.
> >
> > "Don't rely on luck to find a bug."
> >
> >
> > On Mon, Sep 27, 2010 at 5:24 AM, hareendra seneviratne <
> > [email protected]
> > > wrote:
> >
> > > Hi all,
> > >
> > >
> > >
> > > I’m new to struts and getting to know it.
> > >
> > >
> > >
> > > Is it mandatory to have an ActionForm? Can we access the variables
> > defined
> > > in *view* from *execute()* method without using an ActionForm?
> > >
> > >
> > >
> > > Thnks for ur replies J
> > >
> >
>