We are going to migrate an application from Struts 1.3 to Struts 2. What is way to implement ActionForm reset method in Struts2.
For example In Struts 1 reset method we get values from database before action or view(JSP) is executed.
We are going to migrate an application from Struts 1.3 to Struts 2. What is way to implement ActionForm reset method in Struts2.
For example In Struts 1 reset method we get values from database before action or view(JSP) is executed.
The only reasonable intention is to drop reset methods, because they are useless.
The values could be initialized many different ways including the constructor, injection, with @Value, prepare(), resources, interceptors, etc.
To address the values populated from the db the paramsPrepareParams could be used. See
Changing parameters after bind in Struts 2 to learn how to get parameters before they are populated to the model objects.