gpt4 book ai didi

java - Struts ActionForm 替换为 ValidatorForm

转载 作者:行者123 更新时间:2023-12-01 04:25:42 24 4
gpt4 key购买 nike

将下面的ActionForm替换为ValidatorForm是否会导致现有逻辑发生任何变化?

public class EditForm extends ActionForm {

existing logic(setters(), getters(), reset(), validate() )

}

public class EditForm extends **ValidatorForm**{

existing logic(setters(), getters(), reset(), validate() --> **will it be affected?**

}

最佳答案

真正的区别是:

This class extends ActionForm and provides basic field validation based on an XML file. The key passed into the validator is the action element's name attribute from the struts-config.xml which should match the form element's name attribute in the validation.xml.

但是,可能会改变的逻辑是出现验证错误时要执行的操作。

关于java - Struts ActionForm 替换为 ValidatorForm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18517232/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com