在BLC中,我想提供自定义逻辑来验证运费和结算表单。 这两个验证器在下面的代码中定义,分别在BroadleafShippingInfoController和BroadleafBillingInfoController中使用。
@Component("blShippingInfoFormValidator") public class ShippingInfoFormValidator implements Validator @Component("blBillingInfoFormValidator") public class BillingInfoFormValidator implements Validator有什么办法可以创建我的自定义验证器类,可以用它来代替BLC框架中的ShippingInfoFormValidator和BillingInfoFormValidator?
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 ValidatorIs 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?
最满意答案
找到了一种方法,它更多的是弹簧配置而不是其他任何东西。
假设CustomShippingInfoFormValidator是ShippingInfoFormValidator的扩展,那么我只需要在spring配置文件中添加以下行
<bean id="blShippingInfoFormValidator" class="package.to.CustomShippingInfoFormValidator" />Found a way to do this, it is more of spring configuration than anything else.
Suppose CustomShippingInfoFormValidator is an extension of ShippingInfoFormValidator then i just have to add following line to spring configuration file
<bean id="blShippingInfoFormValidator" class="package.to.CustomShippingInfoFormValidator" />更多推荐
BillingInfoFormValidator,BLC,定义,ShippingInfoFormValidator,验证,电脑培训,计算机培训,IT培训&quo
发布评论