struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 27439] New: - Form definition inheritance support
Date Thu, 04 Mar 2004 15:07:28 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27439>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27439

Form definition inheritance support

           Summary: Form definition inheritance support
           Product: Struts
           Version: 1.1 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Controller
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: maslovsky@mail.ru


I've created a simple class derived from FormBeanConfig, which allows to 
inherit form definitions in struts-config.xml files. For example:

<struts-config>
    <form-beans>
		<form-bean name="defaultWorkItemForm" 
type="com.elster.web_framework.forms.WorkitemDynaValidatorForm">
			<form-property name="workitemId" 
type="java.lang.Integer"/>
		</form-bean>
		
		<form-bean name="nameForm" 
type="com.elster.web_framework.forms.WorkitemDynaValidatorForm"
		
	className="com.elster.web_framework.forms.AdvancedFormBeanConfig">
			
			<set-property property="inherits" 
value="defaultWorkItemForm"/>
			<form-property name="name" type="java.lang.String"/>
		</form-bean>


In the above example, the forst form "defaultWorkItemForm" will have  a signle 
Integer property named "workitemId". The second form will be defined as 
inheriting from the "defaultWorkItemForm", and adds additional property 
String "name".

Form definitions can be overriden - if you specify a property with the same 
name that exist in the base form, it's definition will be replaced.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Mime
View raw message