why does struts reset my form after failed validation?

前端 未结 3 589
死守一世寂寞
死守一世寂寞 2021-01-25 14:04

I am using the validation framework with Struts 1.1.When validation fails, the entire form is reset.

After much time scouring the net, I have gathered:

  1. Wh
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-25 14:25

    the reset() is used to clear the values previously entered...if u debug it and see then u'll come to know. eg ur entering 1 in the form and say submit and again come on the same form and enter 2 and submit again now what reset will do is it will clear 1 and now 2, and thus u get 2 in ur validate() part.

提交回复
热议问题