title: Spring MVC - handling form best practice - write specific form class or use entity class?
body: <p>Learning Spring (3.1.0) and Hibernate (4.1.1). Just wondering what most developers do when handling form data. When writing a JSP that contains a form used to submit data, do you normally write a class specific to the input fields on that form and process that server-side or do you just use your entity classes and bind them to the elemtns on the form?</p>
  
  <p>Say I have an application that has 3 entity classes: Location, StoreType and Store (a Store has a StoreType and a Location). On the form on the /CreateStore JSP page I have a dropdown select box with all Locations, another dropdown select box with all the StoreTypes and other text input fields with store name, store manager etc.</p>
  
  <p>Do you create a CreateStoreForm class with a List locationNames, List storeTypes, String storeName etc. and put this on the model? Or do you just put all the various entity classes on the Model separately? I have been using the latter approach but I am thinking that the former may be better especially for re-populating the screen when a user makes consecutive requests to the same screen.</p>