On 12/21/2004 08:13 PM icon911 wrote:
> I am using struts with tiles. Now, I have a questioner that is being
> displayed on a page that calls UrlController. Before it is displayed
> I need to get the values out of the database. The question is since I
> cannot use another action with the urlController to populate the
> actionform bean, should I do the actual data population in the
> urlController or should I create another class, and just initialize it
> from the urlController and the class in turn will do all the data
> retrieval from the database and than urlController will copy the data
> to the actionform bean?
hi Fedor
from your description I'm not totally clear what role the urlController
plays - plus its name is very suggestive of a controller as in
model-view-controller - although it seems it is your view component.
However I think I know what the issue is - you want to seperate the
logic for handling a form submission from the logic for a form
presentation?
From discussions these days it appears this issue is something that
everyone wants the next generation of struts / jsf / whatever to
address, since struts doesn't address it directly now.
You can use another action to populate the form bean - in the forward of
the first action, point it to the URL of a new action. You can even make
it a redirect and the page will display with the appropriate
human-readable URL, if that's important to you. It's known as the
Post-Redirect-Get pattern.
Hope this addresses your question!
Adam
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
|