|
Thanks Niall,
I see from the Struts website that you are a committee member. Well, I now have my name is lights! Anyway, my company uses Struts and was enhancing one of our project's code. I found the LazyValidatorForm to be very useful for what I wanted to do. However, I would have prefered a flavor that doesn't seem to exist. Here's the scenario, we have one of 4 forms that can put up as a web page. Each of the forms has a certain number of fields in common; the others vary from form to form. If this were modeled in OOP terms, you'd have an abstract form that has the common fields and subclasses that add their own. I'm looking for a type of Struts form that, in part, looks like a POJO ActionForm with setters and getters, yet it would have a lazy component to it as well so that other fields could be added to it much like the LazyValidatorForm. I'd like to be able to pull out the common information like this: myForm.getCommonProp1(), myForm.getCommonProp2(), etc. I'd like to reserve the lazy usage pattern (i.e. myForm.get("specialProp1") ) for the specialized properties. I tried to compose something like this using: LazyDynaBean, WrapDynaBean, subclassing, etc. All to no avail! Do you see something useful in this? Perhaps I could write it and become a Contributer! Let me know. - Stuart Niall, If this is fixed, I would like to assign this to 1.3.6 and resolve it. Are you finished with it?
Hi Paul,
resolving this as fixed. Stuart, in Struts 1.3 you can inherit "dyna" forms using the "extends" attribute - maybe that will meet your need? One possible issue with what you describe is how beanutils treats DynaBeans and POJO's - if its a DynaBean then any regular properties are ignored. Possiblly I have mis-understood - if you do come up with an alternative implementation that you want to share with others then by all means open a Jira ticket and submit it back. |
|||||||||||||||||||||||||||||||||||||||||||||
http://svn.apache.org/viewvc?view=rev&revision=472728
If you need a workaround you could create your own FormBeanConfig implementation, modify it to correctly recognise session scoped LazyValidatorForm that can be reused and configure Struts to use your FormBeanConfig implementation.
This issue and the related bug
STR-2507could probably do with back-porting to the 1.2.x branch.Niall