> (2) Whatís the minimal information that one needs to retrieve an Actionís
 > corresponding ActionForm object?

ModuleConfig modConf = ModuleUtils.getInstance().getModuleConfig(request); FormBeanConfig fbc = modConf.findFormBeanConfig(mapping.getName());

(since 2004/01/24):
ActionForm form = RequestUtils.createActionForm(fbc, servlet);

A form must always have a servlet; this is deep in the API of the ActionForm.

These are initial steps towards making it easier to get an ActionForm instance for prepopulation on the way to the view. Be warned, this method does not use any of the logic for looking up an existing form bean in request or session scope under any name, either the forms name or the 'attribute' property of an ActionMapping, since as you can see, the method gets neither a request or an action mapping.

I have been thinking about adding a method:
RequestUtils.createActionForm(fbc, servlet, request, scopeString, attributeString) which would integrate that logic as well, but I was waiting to make sure that no one objected to what I did a few weeks ago. Actually, I would also prefer to use a different method name like 'findOrCreateActionForm' but I don't love that name, so I'm also waiting to come up with a method name that I like.


Also, there has been a lot of effort to factor certain things out of RequestUtils, so maybe it's time to find a different home for these methods. FormUtils?

Joe

--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to