problematically creating input form elements in jsp
===

I have a unique requirement where the input text elements on my jsp are displayed based on the data from a table in the database. The idea is to programmatically display the input elements on the jsp instead of hard coding them. Since I am dealing with hundred odd input elements I thought creating a JSON object would be the most viable option, but this does not really help while doing server side validations. So I finally decided to to use Spring MVC and am hard coding each element in the jsp which does't seem like the best way to go about it in this situation. Is there a better and elegant way to dynamically build a form when we are not sure what the input elements are going to be (In this case the list is coming from a database)?  
I would appreciate your response.

Thanks,
Karthik