Generifing MVC spring select lists

In my previous article I have shown how to create a simple form with two select boxes using spring form from MVC. When we have an application with may forms we want to be able to use a general model for backing the data. We also might want to have certain elements multiple times, e.g. not one Customer but several. We will take theses step by step. „Generifing MVC spring select lists“ weiterlesen

Spring MVC forms with select drop down list

I’m currently developing a Spring MVC application that uses forms. Some of the form elements provided are easy enough to use with a backing model (such as simple input fields (text, password, textarea)). With the selection list however I had problems since I could not work out how to populate the form from the model and how to handle the submit event. All this is probably caused by the complexity of the problem domain and the used model. Therefore I set out and implemented an easy example. There are some articles on how to do that but none with the Annotation process introduced since Spring 2.5. My example is based on this article Spring MVC dropdown example. „Spring MVC forms with select drop down list“ weiterlesen