binder addition
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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">
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user