Just wondering if there is a way in Spring to have a parent controller:
<bean id="parentController" class="org.springframework.web.portlet.mvc.SimpleFormController" abstract="true">
<property name="validator" ref="validatorImpl"/>
...
</bean>
, and a class extending it:
<bean id="child1Controller" class="com.portlet.controller.Child1Controller" parent="parentController">
<property name="validator"><null/></property>
...
</bean>
<bean id="child2Controller" class="com.portlet.controller.Child2Controller" parent="parentController">
...
</bean>
, in such a way that the child overrides a property to null.
I know if you don't declare the property in either the parent or the child, you get the wanted effect, but as in most of the places validator refers to validatorImpl, I thought as a inheritance principle, I would be able to override a property to null.
I keep getting:
15:29:50,141 ERROR [PortletHotDeployListener:534] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'childController' defined in PortletContext resource [/WEB-INF/context/sugerencia-context.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'childController' defined in PortletContext resource [/WEB-INF/context/sugerencia-context.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException
On the other hand,
<bean id="parentController" class="org.springframework.web.portlet.mvc.SimpleFormController" abstract="true">
...
</bean>
<bean id="child1Controller" class="com.portlet.controller.Child1Controller" parent="parentController">
...
</bean>
<bean id="child2Controller" class="com.portlet.controller.Child2Controller" parent="parentController">
<property name="validator" ref="validatorImpl"/>
...
</bean>
Thanks.