Re: S2 life cycle

2007-04-11 Thread tom tom
should I have the following in my jsp Let me know? Thanks, Lalitha --- tom tom <[EMAIL PROTECTED]> wrote: > Yes I know we can do this, > > but the argument is the previous struts ActionForm > sharing across many action classes is achieved by > ScopedModelDriven in Struts 2. > > Having sess

Re: S2 life cycle

2007-04-11 Thread tom tom
Yes I know we can do this, but the argument is the previous struts ActionForm sharing across many action classes is achieved by ScopedModelDriven in Struts 2. Having session scoped beans as members in action classes doesnt sound as a good MVC pattern to me. If there is a infrastructure in plac

Re: S2 life cycle

2007-04-11 Thread Harring Figueiredo
tom: I have not experience with the ModelDrivenInterface. What is that you are trying to do? (It it is to keep a bean around to share between action invocations, have you tried this? class FirstAction extends ActionSupport{ public String execute(){ Bean bean = new Bean(); bean.setW

Re: S2 life cycle

2007-04-10 Thread tom tom
Works but the values get reset all the time, doesnt stay in the session scope, if I update form in the one action class and if I try to retrieve from the other action class the values has been lost. Should I have to do any extra things --- Dave Newton <[EMAIL PROTECTED]> wrote: > --- tom tom

Re: S2 life cycle

2007-04-10 Thread tom tom
Well I tried ScopedModelDriven Yes it works but the values get reset all the time, The form is defined as it is in session scope. What I did was I got two action claases which extends ScopedModelDriven I update the form value in one action class and retrieve the value in the other but it looks

Re: S2 life cycle

2007-04-04 Thread Harring Figueiredo
Tom, I forgot to mention that unlike S1, in S2 the action class does not have to be thread safe - The action class will be instantiated for each request, and thus it will have its own instance of the POJO or member variables. You can pass the "ActionForm", in our case, the POJO object to another

Re: S2 life cycle

2007-04-04 Thread joey
I prefer to achieve it by writing some java code than xml snippet. Maybe migrating from struts1.x would do this. If I just wanted to share more than one form within some actions,I must declared more than one interceptor.If I achieve it by only java code,I only need write a base action and extend i

Re: S2 life cycle

2007-04-03 Thread tom tom
Thanks, Any samples or documenation around for me to refer. I followed this http://struts.apache.org/2.x/docs/scoped-model-driven-interceptor.html but didnt work. Thanks --- Dave Newton <[EMAIL PROTECTED]> wrote: > --- tom tom <[EMAIL PROTECTED]> wrote: > > How can I have a reference to the

Re: S2 life cycle

2007-04-03 Thread Dave Newton
--- tom tom <[EMAIL PROTECTED]> wrote: > How can I have a reference to the form class inside > the action class. I did the following > > 1) Wrote a action class which implements > ScopedModelDriven interface, the argo is not null > inside setModel(Object arg0)method in the action > class but I ca

Re: S2 life cycle

2007-04-03 Thread tom tom
Actually the two concerns I stated in my previous mail were regarding the ScopedModelDriven Anyhow I am proceeding with ScopedModelDriven assuming I can achieve the two concerns I have even with ScopedModelDriven. How can I have a reference to the form class inside the action class. I did the fo

Re: S2 life cycle

2007-04-03 Thread Mark Menard
On 4/3/07 8:13 PM, "tom tom" <[EMAIL PROTECTED]> wrote: > 1) Will introspecttion works as in struts 1.x > (automatic population from the jsp form fields, > provided the pojo got necessary setters and getters. Yes. If you have a property foo on your action (ie: setFoo (Object in) ), then a text fi

Re: S2 life cycle

2007-04-03 Thread Dave Newton
--- tom tom <[EMAIL PROTECTED]> wrote: > 1) Will introspecttion works as in struts 1.x > (automatic population from the jsp form fields, > provided the pojo got necessary setters and getters. Yes. See the CRUD documentation for easy examples: http://struts.apache.org/2.x/docs/crud-demo-i.html >

Re: S2 life cycle

2007-04-03 Thread tom tom
Thanks, Only two concerns I have 1) Will introspecttion works as in struts 1.x (automatic population from the jsp form fields, provided the pojo got necessary setters and getters. 2)How about the execution of validate method as per struts 1.x, in struts 1.x Action form has the validate method w

Re: S2 life cycle

2007-04-03 Thread Mark Menard
On 4/3/07 7:46 PM, "tom tom" <[EMAIL PROTECTED]> wrote: > We can have one ActionForm with session scope shared > across many action classes. (which I believe as a nice > feature). How can I achieve such a thing in S2, In > S2's way if we have this POJO as a Action attribute, > what is it's scope?

Re: S2 life cycle

2007-04-03 Thread tom tom
Thanks for the reply, Well, Looks like model and controller bined together(with context to the MVC). Any how whole idea of a ActionForm is not only for one request or even not only for one Action Class (in Struts 1.x), We can have one ActionForm with session scope shared across many action class

Re: S2 life cycle

2007-04-03 Thread Harring Figueiredo
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 ()...{ } /*

S2 life cycle

2007-04-02 Thread tom tom
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