-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Wes,

Sorry for the delay in replying... I hadn't noticed that your reply was
here.

On 4/28/2010 11:49 AM, Wes Wannemacher wrote:
> I can understand your desire to remove the dependency of struts,
> making your actions reusable. But at the same time, without the helper
> methods that ActionSupport provides, implementing a mechanism for
> displaying validation failure error messages in the struts tags
> becomes extremely difficult.

Agreed. I was just hoping that there might be a way for Struts 2 to do a
kind of duck-typing in these situations. Perhaps I could write a single
class that subclasses ActionSupport (or implements the appropriate
interfaces) and can wrap any class, passing-through all the method
calls. That will probably require some nasty on-the-fly compilation of
classes, but I'm really trying to avoid having 2 classes for every
action: one to do the real work, and one to provide the appropriate
interface to Struts.

It's like S1 all over again :(

The motivation here is that we want to use the same business and
controller objects for our webapp as well as a non-web-based app, where
the use of S2 doesn't make any sense.

> I will add, ActionSupport is linked only against classes provided by
> the JDK.

Yes, but it's kind of ugly to tear ActionSupport out of the rest of the
S2 libraries just to get validation working.

> And, that extending ActionSupport isn't a requirement, but not
> extending it means you will lose mostly the integration with the tags
> on the frontend.

Well, it seems that the validation itself can't properly run unless
there is ActionSupport present. Without it, the error messages aren't
written anywhere, which significantly limits the usefulness of the
validator.

What if the validator could accept a separate object that knows how to
collect error messages? That's why I was asking if another object could
go onto the value stack to accept the error messages.

> Even if you still don't want struts/xwork classes in your validation,
> i would suggest the OVal plugin, combined with a delegatory setup for
> executing your beans.

I'll definitely check-out OVal.

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw9xJ4ACgkQ9CaO5/Lv0PDNJACeMAp/XpJKPoutdwUw/229ukLm
/ykAn2JVGvAvp2hDhptQxL0GbA+fhdnB
=L2DR
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to