1

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.

Roman C
  • 49,761
  • 33
  • 66
  • 176

1 Answers1

1

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.

Community
  • 1
  • 1
Roman C
  • 49,761
  • 33
  • 66
  • 176