|
From: Alef A. <al...@jt...> - 2005-03-12 14:27:05
|
Colin, I talked about wrapping the command objects in the blog but I guess I = forgot that I could do it using an inner class as well. This certainly = makes things much cleaner!=20 About integrating with WebWork, there is a tiny section about the = integration code in the reference docs. I could put a bit more content = in there. I'll spend some time on that tomorrow. I can certainly have a more = thorough look at WebWork next week or the week after. rgds, Alef -----Original Message----- From: spr...@li... on behalf of = Colin Sampaleanu Sent: Fri 3/11/2005 10:01 PM To: spr...@li... Subject: [Springframework-developer] Spring FormController with multiple = commands =20 Alef, I was looking at your blog entry about the topic of supporting=20 multiple command objects in the form controllers. http://blog.arendsen.net/?p=3D23 I actually think it'd be an excellent idea to take a more exhaustive=20 look at WebWork in terms of plugging any deficiencies in Spring MVC in=20 terms of things that WebWork can do easily which Spring MVC can't. (at=20 the same time, as I mentioned to Jason Carreirra at TSSJS, I'd like to=20 also make it easier for people to use WebWork with Spring if they really = want to, by at least pointing to some of the integration code and=20 documenting its existence a bit better). However, on the subject of supporting binding to multiple command=20 objects, the idiom I've found pretty handy in the case is simply to have = a static inner class in my controler for this purpose. It's completely=20 trivial to do: public XXXXX extends AbstractFormController { . . . public static class Command { MyDomainObject myDomainObject =3D new MyDomainObject(); MyOtherObject myOtherObject =3D new MyOtherObject(); public MyDomainObject getMyDomainObject() { return myDomainObject } public MyOtherObject getMyOtherObject() { return myOtherObject } } } There's no need for anybody else other than the JSP page or the=20 controller to know about this inner Command class, and code management=20 is super-simple... Colin ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |