struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harring Figueiredo" <harri...@gmail.com>
Subject Re: S2 life cycle
Date Tue, 03 Apr 2007 13:35:02 GMT
Tom,

In S2, the ActionForm is the Atcion itself. In other words, whatever you
achieved with Action form you now achieve with the Action itself (And
potentially a POJO).
Maybe an example will help.

class MyA extents ActionSupport{
 private String foo;
 private String bar;

... execute ()...{

}

/** These methods will be called automagically (introspection) by the
framework, _AS LONG_ as the param matches the
names of your peroperties (foo will be set by calling setFoo(), the same for
barr)
**/
public void setFoo(String paraFoo){
..
}
public void setBar(String paramBar)
..
}


Now, with the class above, you can have a HTML form with the "foo"and "bar"
fields.



If you what to use a complete separate POJO (for re-usability or other
purpose) you can:

clas myFooBar{
   filed pars  (foo, bar)
  setters and getters
}

class MyA extents ActionSupport{
  private myFooBar fooBar;

  public String execute(){}

}


Now, in the HTML page, you have to say name the param myFooBar.foo and
myFooBar.bar

Regards,
Harring
Hope this helps.

Harring
On 4/3/07, tom tom <j_lalith@yahoo.com> wrote:
>
> Hi All,
>
> What is the life cyle of S2 with regard to
> ActionForms,Actions etc
>
> Because S1 got the life cycle where it executes
> ActionForm validate method and if success only it goes
> to the Action Class.
>
> How this life cycle is addressed in S2, Won't there
> any Action form and also validate method's in S2.
>
> If someone wants to have attributes in a seperate bean
> instead of the Action class, what is the mechanism.
> (How S1 ActionForm is addressed in S2)
>
> in S1 we had the ability to keep forms in any scope
> e.g request or session,
>
> In S2 how can this be achieved.?
>
> Is there any documentation written with regard to
> this,
>
>
> Thanks,
>
>
>
>
>
>
>
> ____________________________________________________________________________________
> Don't pick lemons.
> See all the new 2007 cars at Yahoo! Autos.
> http://autos.yahoo.com/new_cars.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Sincerely,

Harring Figueiredo
Sr. Software Engineer
Email: harringf@gmail.com
Telephone: 941-256-0600

"We never become truly spiritual by sitting down and wishing to become so.
You must undertake something so great that you cannot accomplish it
unaided."

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