Wednesday, September 24, 2003

Man, it's been a long time since I've updated this. I am still alive, I just haven't had any interesting work related comments to share.

Struts continues to be both helpful and frustrating. I've tweaked my design pattern for form pages now. I still have two action mappings, initEditForm.do and editForm.do . The change I had to make was to the "input" attribute of the editForm.do action. Whereas I used to have it the same as the initEditForm action, I now have created a new dispatch, "error" which does all the same initialization that the "init/unspecified" action does without setting any values in the form bean. I had to make this change because I was setting values in the init action so that the form would be prepopulated with the values to be edited. However, if validation failed when the form was submitted, I was clobbering the user's input by repopulating the form. The "input" still needs to point to the initEditForm action because if we set it to the editForm action, we'd end up in an endless loop where the request would be validated, fail, be sent to editForm, where it would be validated, fail, be sent to editForm....