0

In BLC, I want to provide custom logic to validate shipping and billing form. The two validators are defined as in below code and are being used in BroadleafShippingInfoController and BroadleafBillingInfoController respectively.

@Component("blShippingInfoFormValidator")
public class ShippingInfoFormValidator implements Validator

@Component("blBillingInfoFormValidator")
public class BillingInfoFormValidator implements Validator 

Is there any way by which I can create my custom validator classes which can be used in place of ShippingInfoFormValidator and BillingInfoFormValidator in BLC framework?

4

1 回答 1

0

找到了一种方法来做到这一点,它更多的是弹簧配置。

假设 CustomShippingInfoFormValidator 是 ShippingInfoFormValidator 的扩展,那么我只需在 spring 配置文件中添加以下行

<bean id="blShippingInfoFormValidator" class="package.to.CustomShippingInfoFormValidator" />
于 2014-12-21T12:45:15.003 回答