Re: [Webwork-user] Extending something other than ActionSupport
Brought to you by:
baldree,
rickardoberg
From: Rickard <ri...@jb...> - 2000-12-04 12:57:20
|
Tim White wrote: > Rickard has mentioned before that a form bean could extend a data class > rather than ActionSupport. How would this work in practice? Do I need > to manually implement all the stuff from ActionSupport or > ActionFormSupport in the bean? Am I going to run into polymorphism > problems because I'm not extending ActionSupport? Well, there are two ways (at least). If your data class is being written explicitly to be used within WebWork, then you can let it subclass ActionSupport, or ActionFormSupport (if you want the cooler error message handling). However, I just stumbled into this problem myself since I had a data object from EJB which should not have to deal with WebWork. To accomodate this I have now changed the *Support classes to be concrete (i.e. not "abstract"). This allows them to be used through delegation instead of subclassing. I.e. you can have your form bean subclass the data bean, and also instantiate an ActionSupport class which it can delegate to at appropriate times (e.g. execute would call "as.getResult()" instead of "getResult()"). Is this sufficient? The above fixes has been added to CVS, but are not yet available as a file release. /Rickard -- Rickard Öberg Email: ri...@jb... |