Hi,
I am having serious problems with code I have written with Spring so I have decided to start from scratch and ask for advice. Here are my requirements:
- When the page first loads I need a list of objects retrieved from the DB that I can access on the JSP.
- I use this list to populate a drop down.
- When the user selects
an object from the drop down the
form below is populated by the
appropriate data (all of this
data is available as it is
retrieved when the page is first
loaded) - The user can modify this data and submit the form. I need to save this data to the DB
- The
page should be reloaded and needs
to retrieve the list of objects
from the DB again as they have
changed and make this list
available to the JSP.
I have been using SimpleFormController and the referenceData() and onSubmitAction() methods but I'm not sure if this is the best solution. I think my problem is that after onSubmitAction is finished the list of objects is not available in the JSP as referenceData() is not called after onSubmitAction() finishes.
Apologies if this is a silly request. I have been googling and looking for tutorials for 2 days and I cannot find an example that does what I need it to do.
So my question is which methods should I be implementing to meet these requirements?