I am a newbie to spring mvc annotations. Which is the best way to load data into a page that has say a string, list (list of country for a drop down) and some form elements like name and address
I see two possible ways
- @ModelAttribute on a method - can be used for string, list, initialize the form elements
- Put the string, list into ModelAndView in the RequestMethod.GET method
Can anyone shed light on the pros and cons.
Also can some one give a brief example on how to load reference data and form data. What goes inside a form backing object (just the form elements like an address object or the reference data also)