I have just started learning struts. Most of the tutorials I read, it mentions capturing data using an ActionForm. ie. Performing a http post request with a form filled with data.
However, upon the initial loading of the form, populating of the dropdown boxes etc. How should I retrieve the data and populate to the view?
-
By saving the ArrayList to the request attribute and iterate it on the jsp.
-
Setting the ArrayList to a corresponding string[] array in the ActionForm.
Which is the correct / better implementation approach?
in your
Actionclass you can fetch the data using services and store it in aListwhich is a property of aForm