Archive for February 1st, 2008

Welcome Back

It has been a long time since I’ve posted. I started a new job back in the middle of November and that plus the holidays made life just a bit too hectic to blog at all. I really want to do this regularly and I hope now that everything has calmed down a bit that I can ;)

How *not* to use the Spring MVC Form tag library

I hadn’t used the Spring form tag library before and decided to give it a shot for a small test form I was creating. I am using a subclass of SimpleFormController to return a simple list of value/name pairs from a database call to populate a select/option list in the HTML. I figured it would be easy enough to return an ArrayList as my command object and that is populated with HashMaps of the key/values. Oops. Doesn’t work.

It appears that I have to create an object that holds the list (or maybe a list of objects with fields that are the items I need displayed in the select dropdown). It’s too bad that I can’t do it the way I want with that tag library ;) Since this is a throw away screen though (I suppose the controller is as well) I’m not going to worry too much about it :)