struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Menard <>
Subject Re: S2 life cycle
Date Wed, 04 Apr 2007 01:19:17 GMT
On 4/3/07 8:13 PM, "tom tom" <> 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 field in your jsp like so:

    <s:textfield name="foo" />

Will populate that property of your action.

> 2)How about the execution of validate method as per
> struts 1.x, in struts 1.x Action form has the validate
> method which will fire before the control delegate to
> the Action class.

You can implement the com.opensymphony.xwork2.Validatable interface so
handle validation. Alternatively you could explore the validation framework,
and use XML files to manage the validation.

I think if you're sharing the form between multiple actions that using a
validate method might be easier. You could put the validate() in a super
class and then implement a different execute() in each descendant.

> Can I achieve the above using ScopedModelDriven
> mechanism.

You can work ScopedModelDriven into it.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message