struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hareendra seneviratne <hareend...@gmail.com>
Subject Re: Accessing User input in execute ( ) method
Date Wed, 29 Sep 2010 07:02:10 GMT
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 <nanatafen@gmail.com> 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 <
> hareendras@gmail.com
> > 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
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message