问题
I am using struts 1.3 and my data on the jsp page gets reset if my validation fails. It displays the error messages coming from the ActionForm from the validate method, but resets my entire jsp. i tried using struts tags instead of html but it is not helping out.
I even tried looking at this https://stackoverflow.com/a/20499877/1771406 but i dint clearly understand what exactly he is trying to say. can anyone one help me by showing some implemented code please.
回答1:
the reason why my code was not working inspite of seting getters and setters and html strut tags was only due to this silly mistake of mine
<html:text property="abc" value=""/>
when that value attribute was removed it then worked perfectly fine.
correct code:
<html:text property="abc"/>
来源:https://stackoverflow.com/questions/22712685/how-to-retain-data-on-the-view-jsp-if-the-validation-fails-in-struts