PDA

View Full Version : org.springframework.validation.BindException



ramiya
Jul 21st, 2005, 07:37 PM
The sellitem sample seems to be working (except for the back button). But I see this in my logs:

2005-07-21 17:30:29,551 DEBUG [org.springframework.webflow.execution.FlowExecutio nManager] - <Returning selected view descriptor [ViewDescriptor@1f23f8b viewName = 'priceAndItemCountForm', redirect = false, model = map['org.springframework.validation.BindException.sale ' -> org.springframework.validation.BindException: BindException: 0 errors, 'actionForm' -> org.springframework.web.struts.SpringBindingAction Form@126ecd2, 'org.springframework.validation.BindException.#for mObject' -> org.springframework.validation.BindException: BindException: 0 errors, '#formObject' -> [Sale@c3bb57 price = 0.0, itemCount = 0], 'sale' -> [Sale@c3bb57 price = 0.0, itemCount = 0]]]>


How do i fix this?

thanks,
Ramiya

Keith Donald
Jul 22nd, 2005, 12:45 AM
Fix what? That's just a debug log noting what view should be rendered next and what model data it needs. Looks fine to me.

Don't let the class name BindException scare you (see JavaDocs). It's not a thrown exception here, it's jjust an object thats capable of accessing/formatting form object property values as well as collecting rejected values and validation errors.

--

Are you running sell item with Struts?

If so, you have to configure the FlowAction's FlowExecutionManager to use continuations for browser back button support.

The easiest way to do this is to use a DelegatingActionProxy to delegate to a Spring-managed flow action.

Keith

ramiya
Jul 22nd, 2005, 01:04 AM
Modified sellitem sample to add struts integration. This is how the context.xml looks. Seems to be working fine with "GET". I will try the DelegatingActionProxy.


<bean name="*.do" class="org.springframework.webflow.mvc.FlowController">
<property name="cacheSeconds" value="5"/>
<property name="flowExecutionManager" ref="flowExecutionManager"/>
</bean>

<bean id="flowExecutionManager" class="org.springframework.webflow.execution.servlet.Serv letFlowExecutionManager">
<property name="listener">
<bean class="org.springframework.webflow.samples.sellitem.SellI temFlowExecutionListener"/>
</property>
<property name="storage">
<bean class="com.abc.weblib.spring.FlowExecutionStorage">
<property name="compress" value="false"/>
</bean>
</property>
<bean id="sellItem" class="org.springframework.webflow.config.FlowFactoryBean">
<property name="flowBuilder">
<bean class="org.springframework.webflow.samples.sellitem.SellI temFlowBuilder" autowire="byType"/>
</property>
</bean>

<bean id="sellItemAction" class="org.springframework.webflow.samples.sellitem.SellI temAction">
<property name="validator">
<bean class="org.springframework.webflow.samples.sellitem.SaleV alidator"/>
</property>
</bean>
</beans>