Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

4 - Wiring in custom beans

4 - Wiring in custom beans

After extending a number of Storefront classes, you need to tell Storefront to use your extension classes instead of the out of the box classes. To do this, you need to replace some Java Bean definitions.

  1. In ext-storefront/src/main/resources/META-INF/conf/ep-storefront-plugin.xml, insert the following beans under the <beans> tag:
    	<bean id="cartFormBeanFactory" parent="cartFormBeanFactoryTemplate"
    	<bean id="shoppingItemDtoMapper"
    	<bean id="shoppingItemFormBean"
    	<bean id="tshirtProductConfigController" parent="defaultProductConfigController">
    		<property name="shoppingItemValidator" ref="tshirtFormBeanValidator"/>
    	<bean id="tshirtFormBeanValidator"
    		<property name="errorCodeMap">
    				<entry key="errorFrontTextSize" value="errors.tshirt.front.text.too.long"/>
    				<entry key="errorBackTextSize" value="errors.tshirt.back.text.too.long"/>
    	<bean id="shoppingItemConfigController" parent="shoppingItemConfigControllerTemplate">
    		<!-- This property contains the map from type names to the ProductConfigController
    			which handles the specialisation. -->
    		<property name="productTypeNameControllerMap">
    			<map merge="true">
    					<!-- product type name -->
    					<ref bean="tshirtProductConfigController"/>
    		<property name="bindingConfig">
    			<list merge="true">
    				<binding-config:binding pattern="cartItems[*].tshirtFields.frontText" policy="ignore"/>
    				<binding-config:binding pattern="cartItems[*].tshirtFields.backText" policy="ignore"/>
  2. These beans wire in the custom TshirtFormBean and the TshirtFormBeanValidator, wire in your extensions to the out of the box Storefront classes, and binds the data submitted in the t-shirt form fields.
  3. In ext-storefront/src/main/resources/META-INF/conf/ep-storefront-plugin.xml, add the definition for the binding-config property by replacing the <beans> tag with the following:
    <beans xmlns=""

Building the Extensions

After wiring in your Storefront extension classes, you are ready to build and deploy the Storefront extension:

  1. With the command prompt, navigate to the ext-storefront project directory and run:
    mvn install
  2. Navigate to ext-storefront-webapp and run:
    mvn install
  3. Deploy your extended storefront WAR to your web server.