On 1/4/06, Rick Reumann <[EMAIL PROTECTED]> wrote:
>
> Since I've been working on a rich client .NET app for a while, I've been
> a bit out of the loop on all the latest 'goings on' in regard to
> frameworks. (I couldn't keep up with all the Struts/JSF/Shale/WebWork
> comments on the list a while a back.)
>
> I'm actually quite happy with what Struts has to offer except for the
> deal with having to use ActionForms. I'd really like a Struts-like
> framework but allows me to use POJOs to capture my data and provides a
> nice way to redisplay that data back to the user if validation fails (ie
> a POJO that backs a form with a Data datatype will display back the
> String they entered). The managed bean approach to JSF that I've used
> some was REALLY nice - but I'm not yet convinced I want everything else
> in regard to JSF at this time.


I don't know why ... JSF already does exactly what you are asking for here.
Your backing beans don't have to be ActionForms ... they can be POJOs.  The
properties of your POJOs can use native data types, because the components
take care of redisplaying the string formats for you on invalid data.
Converters can be registered explicitly, or defaulted based on the data type
of the POJO property you bind to.  Validators can be added (and, if you add
Shale to the mix, you can get exactly the same Commons Validator support for
client side and server side validation that Struts Action Framework offers).

And, you get managed beans too :-).

Will the collaborative effort between Struts and WebWork possibly be
> exactly what I'm looking for? I looked at WebWork a long time ago and it
> looked like it took a managed bean approach type of an approach and no
> need for ActionForms (but I never really used it, so I could be way off.)


The current WW code is somewhere in the middle between Struts 1.x and JSF.
It combines the concepts of Action and ActionForm (so your execution method
has direct access to the form data), lets you use native data types), and
creates instances on each request for you.  You used to have to implement
the Action interface, but that's now optional.  It doesn't have "managed
beans" per se, but you could use Spring for that (although you don't get
general binding of component values to model data on them).

The story is yet to be written, but I presume the merged code will carry
forward these sorts of features.

--
> Rick Reumann
> http://www.tech.reumann.net - Struts lessons, articles, etc.


Craig

Reply via email to