binder addition

This commit is contained in:
Keith Donald
2008-07-22 03:21:30 +00:00
parent 454ecc7222
commit b70c76d459
22 changed files with 218 additions and 80 deletions

View File

@@ -0,0 +1,16 @@
package org.springframework.webflow.samples.booking;
import org.springframework.binding.convert.converters.StringToDate;
import org.springframework.binding.convert.service.DefaultConversionService;
import org.springframework.stereotype.Component;
@Component("conversionService")
public class ApplicationConversionService extends DefaultConversionService {
@Override
protected void addDefaultConverters() {
super.addDefaultConverters();
addConverter("shortDate", new StringToDate());
}
}

View File

@@ -22,7 +22,7 @@
</webflow:flow-registry>
<!-- Plugs in a custom creator for Web Flow views -->
<webflow:flow-builder-services id="flowBuilderServices" view-factory-creator="mvcViewFactoryCreator"/>
<webflow:flow-builder-services id="flowBuilderServices" view-factory-creator="mvcViewFactoryCreator" conversion-service="conversionService"/>
<!-- Configures Web Flow to use Tiles to create views for rendering; Tiles allows for applying consistent layouts to your views -->
<bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">

View File

@@ -17,11 +17,12 @@
<binder>
<binding property="checkinDate" converter="shortDate" required="true" />
<binding property="checkoutDate" converter="shortDate" required="true" />
<binding property="beds" required="true"/>
<binding property="smoking" required="true" />
<binding property="creditCard" required="true" />
<binding property="creditCardName" required="true" />
<binding property="creditCardExpirationMonth" required="true"/>
<binding property="creditCardExpirationYear" required="true"/>
<binding property="creditCardExpiryMonth" required="true"/>
<binding property="creditCardExpiryYear" required="true"/>
</binder>
<transition on="proceed" to="reviewBooking" />
<transition on="cancel" to="cancel" bind="false" />