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