Derek Richardson wrote:

I have a superclass, RuleForm, with some subclasses, like ImportRule and ExportRule. In my struts-config file, I specify that my actions deal with  a form-bean named ruleForm in session scope which is defined as type RuleForm. However, the actual class of the bean will usually be ImportRule or ExportRule, not RuleForm.

Or this is what I'd like to work. I am seeing behavior that looks like Struts will not accept the subclasses as substitutes for the superclass. But this behavior may be due to my application logic, not Struts. So I'm hoping someone will tell me whether Struts supports this or not.

The Struts user guide and JavaDoc for ActionFormBean say that the type attribute contains the java class type for the form bean. I just find this somewhat ambiguous, given inheritance.

Struts will use whichever type you specify for the form to instantiate it, so you need to do one of two things:
- manually create the form before Struts has a reason to
- tell Struts the real type of the form

Thanks,

Derek Richardson

--
Eddie Bush





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to